-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNumbaz.java
More file actions
68 lines (65 loc) · 1.29 KB
/
Numbaz.java
File metadata and controls
68 lines (65 loc) · 1.29 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
public class Numbaz
{
public static void main (String[] args) {
double score = 0.0;
System.out.println ("Enter a test score between 0 and 100:");
score = SavitchIn.readLineDouble();
if (score >=90 && score <=100)
{
System.out.println ("thats an A");
}
if (score >=80 && score <=89)
{
System.out.println ("thats a B");
}
if (score >=70 && score <=79)
{
System.out.println ("thats a C");
}
if (score >=0 && score <=69)
{
System.out.println ("try harder");
}
// Even or Odd
if (score%2 ==0)
{
System.out.println ("Score is even");
// prime number
if (score <= 2 && score%2 ==0)
{
System.out.println ("Score is prime");
}
else
{
System.out.println ("Score is not prime");
}
}
else
{
System.out.println ("Score is odd");
}
// divisible by 7
if (score%7 ==0)
{
System.out.println ("Score is Divisible by 7");
if (score%14 == 0)
{
System.out.println ("Score is a multiple of 14");
}
else
{
System.out.println ("Score is not a multiple of 14");
}
}
// score is 97
if (score == 97)
{
System.out.println ("Yay");
}
// less than 0 or more than 100
if (score <0 || score >100)
{
System.out.println ("Shame on you, please enter a number between 0 and 100");
}
}
}