Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.CALCULATOR;
- import java.util.Scanner;
- public class CALCULATE {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.println("Numberone: ");
- int input1 = input.nextInt();
- System.out.println(" Numbertwo: ");
- int input2 = input.nextInt();
- System.out.println("Numberthree: ");
- int input3 = input.nextInt();
- System.out.println("Numberfour: ");
- int input4 = input.nextInt();
- System.out.println("Numberfive: ");
- int input5 = input.nextInt();
- System.out.println("Numbersix: ");
- int input6 = input.nextInt();
- int calcadd1 = input1+input2+input3;
- System.out.println(input1 + " + " + input2 + " + " + " + " + input3 + " = " +
- calcadd1);
- int calcadd2 = input4+input5+input6;
- System.out.println(input4 + " + " + input5 + " + " + input6 + " = " +
- calcadd2);
- double subtract = calcadd1 - calcadd2;
- System.out.println(calcadd1 + " - " + calcadd2 + " = " + subtract);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement