forked from AllenDowney/ThinkJavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmailOffer.java
More file actions
29 lines (27 loc) · 896 Bytes
/
EmailOffer.java
File metadata and controls
29 lines (27 loc) · 896 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
//Exercise 5-J.
public class EmailOffer
{
public static void main(String[] args)
{
determineEmailOffer("IA", 10);
}
public static void determineEmailOffer(String state, int currentSpeed)
{
if ((state.equals("IA")) && (currentSpeed < 30))
{
System.out.println("Congratulations! You are eligible for a free HSI upgrade to 50M.");
}
else if ((state.equals("MO")) && (currentSpeed < 10))
{
System.out.println("Congratulations! You are eligible for a free HSI upgrade to 20M.");
}
else if ((state.equals("MO")) && (currentSpeed < 25))
{
System.out.println("Congratulations! You are eligible for a free HSI upgrade to 50M.");
}
else
{
System.out.println("We are sorry. No HSI Upgrade is available at this time.");
}
}
}