-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProgrammingFundamentals.java
49 lines (34 loc) · 1.02 KB
/
ProgrammingFundamentals.java
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
public class ProgrammingFundamentals {
static String readln() {
return new java.util.Scanner(System.in).nextLine();
}
public static void main(String args[]) {
// Input utente
int x=10;
int y=25;
x=12;
System.out.println("Sum or Difference? (+/-)");
String input = readln();
String op, opDesc;
if ("+".equals(input)) {
op = "+";
opDesc =
} else if ("-".equals(input)) {
} else {
}
////////// FINCHÈ L'UTENTE IMMETTE UN NUMERO, SOMMARE O SOTTRARRE
// QUANDO INVECE IMMETTE "stop", FERMARSI
System.out.println("First number?")
String number = readln();
int total = Integer.parseInt(number);
while (!"stop".equals(number)) {
int z;
}
//////////
// Output
String msg = opDesc + " of x" + op + "y = ";
msg = msg + x + op + y;
msg = msg + " = " + z;
System.out.println(msg);
}
}