Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8c178ac

Browse files
🍵
1 parent f9515d3 commit 8c178ac

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎challenge14.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import java.util.Scanner;
2+
3+
// Create a program that calculates grade based on their marks.🚀
4+
public class challenge14 {
5+
public static void main(String[] args) {
6+
Scanner sc = new Scanner(System.in);
7+
System.out.println("Enter your marks know your grade, you are(A,B,C,D, or F)");
8+
System.out.print("Enter your marks: ");
9+
int marks = sc.nextInt();
10+
if(marks >= 90 && marks <= 100){
11+
System.out.println("Great, You have got Grade (A)");
12+
} else if(marks >= 75 && marks < 90){
13+
System.out.println("Good, You have got Grade (B)");
14+
} else if(marks >= 60 && marks < 75){
15+
System.out.println("Work harder next time, You have got Grade (C)");
16+
} else if(marks >= 30 && marks < 60){
17+
System.out.println("You seriously need to work, You have got Grade (D)");
18+
} else if(marks < 30 && marks >= 0){
19+
System.out.println("Sorry, You have failed you got Grade (F)");
20+
} else{
21+
System.out.println("invalid!");
22+
}
23+
}
24+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /