Assignemnt #22

Code

  /// Name: Sam Wilson
  /// Period: 6
  /// Program Name: calculator
  /// File Name: calculator.java
  /// Date Finished: 10/5/2015
 
  import java.util.Scanner;
    
    public class calculator
    {
        public static void main( String[] args )
        {
            double first, second, third; 
            String state, end;
            
            state = "What is your ";
            end = " number? ";
            
           Scanner keyboard = new Scanner(System.in);
            
            System.out.print(state+"first"+end);
            first = keyboard.nextDouble();
            
            System.out.print( state+"second"+ end);
            second = keyboard.nextDouble();
            
            System.out.print( state+"third"+ end);
            third = keyboard.nextDouble();
            
            System.out.println();
            System.out.print("( "+ first+" + "+ second+" + "+ third+" ) / 2 is "+( ( first+ second+ third) / 2) );
            System.out.println();
            
            
       }
   }
    

Picture of the output

Assignment 22