Las Lomas Computer Science Program #74

Code

   
    /// Name: Afaf Nabeeha
    /// Period: 7
    /// Program Name: Safe Square Root
    /// File Name: Square.java
    /// Date Finished: 12/20/2015 public class Square

        import java.util.Scanner;
        public class Square
        {
            public static void main( String[] args )
            {
                Scanner keyboard = new Scanner(System.in);
                double user, answer;
                System.out.println( "SQUARE ROOT!" );
                System.out.print( "Enter a number: " );
                user = keyboard.nextDouble();
                answer = 0;
                while ( user > 0 )
                {
                    answer = Math.sqrt(user);
                    System.out.println( "The square root of " + user + " is " + answer );
                     System.out.print( "Enter a number: " );
                    user = keyboard.nextDouble();
                }
                    System.out.println( "Error, invalid input. " );
        
            }
        }
             
    

Picture of the output

Assignment 74

Welcome to my Website!

This is a paragraph! Here's how you make a link: Neocities.

Here's how you can make bold and italic text.

Here's how you can add an image:

Here's how to make a list:

To learn more HTML/CSS, check out these tutorials!