-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCC4p1q2.java
More file actions
29 lines (25 loc) · 873 Bytes
/
CC4p1q2.java
File metadata and controls
29 lines (25 loc) · 873 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
// Create a class called School with main funtion
// Create a function called passorfail whather school return the string Pass / Fail
// Inside main function get int input from user for total mark
// Pass that input to the passorfail fuction & let the fuction decide whether student is pass or fail
import java.util.Scanner;
public class CC4p1q2 {
String passorfail(int score)
{
if(score < 35 )
{
return "Fail";
}
else{
return "Pass";
}
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the Number ");
int total_mark = scan.nextInt();
CC4p1q2 obj = new CC4p1q2();
String result = obj.passorfail(total_mark);
System.out.println(result);
}
}