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

Scanner Programs for Conversions and Math

This document contains code for 3 Java programs that use the Scanner class to take user input. The first program converts Celsius to Fahrenheit, the second converts dollars to pesos using a fixed exchange rate, and the third performs basic math operations like addition, subtraction, multiplication and division on two user-input integers in a specific order (MDAS).

Uploaded by

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

Scanner Programs for Conversions and Math

This document contains code for 3 Java programs that use the Scanner class to take user input. The first program converts Celsius to Fahrenheit, the second converts dollars to pesos using a fixed exchange rate, and the third performs basic math operations like addition, subtraction, multiplication and division on two user-input integers in a specific order (MDAS).

Uploaded by

Ruby Bart
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import [Link].

Scanner;
public class CelsiusToFahrenheitScanner {
public static void main (String[] args) {
double Far, Cel;
[Link]("Enter Celcius: ");
Scanner temp = new Scanner([Link]);
Cel = [Link]();

Far = (9.0/5.0) * (Cel + 32);

[Link]("\nEquivalent in Farenhiet: " + Far);


}
}

import [Link];
public class DollarToPesoScanner {
public static void main (String[] args) {
double Dollar, Peso;
[Link]("Enter Amount of Dollar: ");
Scanner amount = new Scanner([Link]);
Dollar = [Link]();
Peso = 45.00 * Dollar;
[Link]("\nEquivalent in peso: P" + Peso);
}
}

import [Link];
public class ScannerMDAS {
public static void main (String[] args) {
int Num1, Num2, A,S;
double M,D;

[Link]("Enter First Number: ");


Scanner N1 = new Scanner([Link]);
Num1 = [Link]();

[Link]("Enter Second Number: ");


Scanner N2 = new Scanner([Link]);
Num2 = [Link]();

M = Num1 * Num2;
D = Num1 / Num2;
A = Num1 + Num2;
S = Num1 - Num2;

[Link]("The Product is: " + M);


[Link]("The Qoutient is: " + D);
[Link]("The Sum is: " + A);
[Link]("The Difference is: " + S);
}
}

You might also like