Exercise CheckPassFail (if-else) ~ Programming is Fun
 Programming is Fun!

www.anandsingh.net
Subscribe For Free Updates!

We'll not spam mate! We promise.

Saturday, September 6, 2014

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:
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( ...... );
      }
   }
}
Comment your Answers :)


Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment