forked from angiejones/java-programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuotaCalculator.java
More file actions
33 lines (27 loc) · 971 Bytes
/
Copy pathQuotaCalculator.java
File metadata and controls
33 lines (27 loc) · 971 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 chapter3;
import java.util.Scanner;
/*
* IF ELSE
* All salespeople are expected to make at least 10 sales each week.
* For those who do, they receive a congratulatory message.
* For those who don’t, they are informed of how many sales they were short.
*/
public class QuotaCalculator {
public static void main(String args[]){
//Initialize values we know
int quota = 10;
//Get unknown values
System.out.println("Enter the number of sales you made this week:");
Scanner scanner = new Scanner(System.in);
int sales = scanner.nextInt();
scanner.close();
//Make a decision on the path to take - Output
if(sales >= quota){
System.out.println("Congrats! You've met your quota");
}
else{
int salesShort = quota - sales;
System.out.println("You did not make your quota. You were " + salesShort + " sales short");
}
}
}