Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
8 views1 page

Sample Two

Uploaded by

Jhonlloyd Bugay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Sample Two

Uploaded by

Jhonlloyd Bugay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import java.util.

Scanner;

public class SampleTwo {

public static void main(String[] args) {


Scanner in = new Scanner(System.in);
double firstNum = 50.50, secondNum = 95, sum = 0, difference = 0, product =
0, quotient = 0;
String name;

System.out.println("Enter Name: ");


name = in.nextLine();

System.out.println("Enter First Number: ");


firstNum = in.nextDouble();

System.out.println("Enter Second Number: ");


secondNum = in.nextDouble();

// MAAATH OPERATORRRRSS
sum = firstNum + secondNum;
difference = firstNum - secondNum;
product = firstNum * secondNum;
quotient = firstNum / secondNum;

// REZALTZZZZZ
System.out.println("Welcome " + name + "!");
System.out.println("The Sum is: " + sum);
System.out.println("The Difference is: " + difference);
System.out.println("The Product is: " + product);
System.out.println("The Quotient is: " + quotient);

in.close();
}
}

You might also like