-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise3_2.java
More file actions
30 lines (23 loc) · 855 Bytes
/
Exercise3_2.java
File metadata and controls
30 lines (23 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public class Exercise3_2 {
// public static String[] str = new String[20];
// public SplitDemo() {
// String s = "you are ringht!";
// }
/**Main method*/
public static void main(String[] args) {
java.util.Scanner input = new java.util.Scanner(System.in);
// Prompt the user to enter an integer
System.out.print("Enter an integer: ");
// int number = input.next();
String strA = input.next();
String strB = input.next();
String strC = input.next();
double intA = Double.parseDouble(strA);
double intB = Double.parseDouble(strB);
double intC = Double.parseDouble(strC);
double value = (intA + intB) * intC;
// Display results
System.out.println("input A, B, C is " + intA + "\t" + intB + "\t" +intC);
System.out.println("value is " + value);
}
}