-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsalesCalculatorUpgraded.java
More file actions
33 lines (26 loc) · 980 Bytes
/
salesCalculatorUpgraded.java
File metadata and controls
33 lines (26 loc) · 980 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
31
32
33
package chapter2;
import java.util.Scanner;
public class SalesCalculatorUpgraded {
public static void main (String[] args) {
// 1. Known values (quota)
int quota = 10;
// 2. unknown values (the actual quota)
Scanner scanner = new Scanner(System.in);
System.out.println("Please enter your number of sales for this week. ");
int employeeQuota = scanner.nextInt();
scanner.close();
// 3. congratulate them or not
if(employeeQuota >= quota) {
System.out.println("Congratulations you got your bonus this week");
} else {
System.out.println("Sorry, you need " + (quota - employeeQuota) + " more sales to get a bonus this week." );
}
/*
From Angie,
else {
int salesShort = quota - employeeQuota;
System.out.println("Sorry you need " + salesShort + " to get your bonus this week.");
}
*/
}
}