Exercise CheckPassFail (if-else) : Write a program called CheckPassFail which prints "PASS" if the int variable "mark" is more than or equal to 50; or prints "FAIL" otherwise.
Hints for Exercise CheckPassFail
1
2
3
4
5
6
7
8
9
10
11
12 | public class CheckPassFail { // saved as "CheckPassFail.java"
public static void main(String[] args) {
int mark = 49; // set the value of mark here!
System.out.println("The mark is " + mark);
if ( ...... ) {
System.out.println( ...... );
} else {
System.out.println( ...... );
}
}
}
|
For Solution visit :
Solution for Exercise CheckPassFail.
Tags:
No Comment to " Exercise CheckPassFail (if-else) "