ACT4_2

mail@pastecode.io avatar
unknown
java
2 years ago
992 B
21
Indexable
Never
package com.ACT4_Mayor_2;

import java.util.Scanner;

public class ACT3_Mayor_2 {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        double result1;
        double result2;
        double result3;
        double result4;

        System.out.print("Enter num1: ");
        double num1 = scan.nextDouble();
        System.out.print("Enter num2: ");
        double num2 = scan.nextDouble();
        scan.close();

        result1 = num1 * num2;
        result2 = num1 / num2;
        result3 = num1 + num2;
        result4 = num1 - num2;


        System.out.println("The product of " + num1 + " and " + num2 + " is " + result1);
        System.out.println("The quotient of " + num1 + " and " + num2 + " is " + result2);
        System.out.println("The sum of " + num1 + " and " + num2 + " is " + result3);
        System.out.println("The difference of " + num1 + " and " + num2 + " is " + result4);

    }
}