Assignemnt #25

Code


/// Name: Daniel Nguyen
/// Period: 6
/// Program Name: Dumb Calculator Program
/// File Name: DumbCalculator.java
/// Date Finished: 9/9/2015

import java.util.Scanner;
  
  public class DumbCalculator
  {
      public static void main( String[] args )
      {
          int firstn, secondn, thirdn, totaldiv2;
           
         Scanner keyboard = new Scanner(System.in);
 
        System.out.print("What is your first number? ");
         firstn = keyboard.nextInt();
 
        System.out.print("What is your second number? ");
         secondn = keyboard.nextInt();
          
           System.out.print("What is your third number? ");
         thirdn = keyboard.nextInt();
          
          totaldiv2 = (firstn + secondn + thirdn) / 2;
          
          System.out.println( "(" + firstn + "+" + secondn +  "+" + thirdn + ")" + "/ 2 is .... " + totaldiv2 );
         
          
      }
 }
    

Picture of the output

Assignment 3
BACK HOME NEXT