-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab9.java
More file actions
118 lines (83 loc) · 2.52 KB
/
Copy pathLab9.java
File metadata and controls
118 lines (83 loc) · 2.52 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import java.util.Scanner;
public class Lab9
{
public static void main(String[]args)
{
Scanner keyboard = new Scanner(System.in);
System.out.print("Enter your numeric assignment score (0-100):");
int score=keyboard.nextInt();
System.out.println(evaluateScore(score));
System.out.println("enter 3 digit area code:");
int code=keyboard.nextInt();
getAreacode(code);
System.out.println("enter the dollar amount purchased in the last month");
int purchase=keyboard.nextInt();
Storepoint(purchase);
}
public static String evaluateScore(int Score)
{
int score = Score;
String answer;
if(score <60)
{ answer="your score is " + score + "need to improve more.";
}
else if(score <=69)
{ answer=" your score is "+score+" Poor, with room to improve.";
}
else if(score <=79)
{answer="your score is "+score+" Just enoguh, but you can do more.";
}
else if(score <=89)
{answer="your score is "+score+ "Good Job.";
}
else if(score <=99)
{answer="your score is "+score+" Exellence.";
}
else
{answer="your score is "+score+" outdstanding";
}
return answer;
}
public static String getAreacode(int areacode)
{
int Areacode=areacode;
switch(Areacode)
{
case 212:
System.out.println("You entered area code "+Areacode+", which for Hampton,VA");
break;
case 202:
System.out.println("You entered area code "+Areacode+", which for Washington,DC");
break;
case 213:
System.out.println("You entered area code "+Areacode+", which for Los Angeles,CA");
break;
case 305:
System.out.println("You entered area code "+Areacode+", which for miami, FL");
break;
default:
System.out.println("no area code found");
}
return "";
}
public static String Storepoint(int point)
{
int purch=point;
if(purch==0)
{System.out.println("you purchased "+purch+" last month, 0 points awarded.");
}
else if( purch <=50)
{System.out.println("you purchased "+purch+" last month, 2 points awarded.");
}
else if(purch <=100)
{System.out.println("you purchased "+purch+" last month, 4 points awarded.");
}
else if(purch <=150)
{System.out.println("you purchased "+purch+" last month, 6 points awarded.");
}
else
{System.out.println("you purchased "+purch+" last month, 8 points awarded.");
}
return "";
}
}