Advertisement
olando2000

Prosper(Scanner)

Feb 23rd, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1. package com.inputtext;
  2.  
  3.  
  4. import java.util.Scanner;
  5.  
  6.  
  7. public class ADDNUMSUBNUM {
  8.  
  9.     public static void main(String[] args) {
  10.         double calcadd1, calcadd2;
  11.  
  12.  
  13.         Scanner input = new Scanner(System.in);
  14.  
  15.         System.out.println("Input  Numberone: ");
  16.         double input1 = input.nextDouble();
  17.         System.out.println("Enter  Numbertwo: ");
  18.         double  input2 = input.nextDouble();
  19.         System.out.println("Enter  Numberthree: ");
  20.         double input3 = input.nextDouble();
  21.         System.out.println("Input Numberfour: ");
  22.         double input4 = input.nextDouble();
  23.         System.out.println("Enter  Numberfive: ");
  24.         double input5 = input.nextDouble();
  25.         System.out.println("Input  Numbersix: ");
  26.         double input6 = input.nextDouble();
  27.  
  28.  
  29.  
  30.         calcadd1 = (input1+input2+input3);
  31.         System.out.println("The value first three numbers is: " + calcadd1);
  32.  
  33.         calcadd2 = (input4+input5+input6);
  34.         System.out.println("The value of the Second three numbers is: " + calcadd2);
  35.  
  36.         double subtract = calcadd1 - calcadd2;
  37.         System.out.println("Difference of the two numbers is: " + subtract);
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement