Advertisement
Duey

OrElseProgram

Sep 20th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. // This is a program that will allow you to enter a mark, from 1 to 100,
  2. // It will tell you whether your number is equal to fifty, larger than fifty or smaller than fifty
  3.  
  4. import java.util.Scanner;
  5.  
  6. class or_else_program {
  7.   public static void main(String[] args) {
  8.    int numberObtained, aboveFifty;
  9.    
  10.    aboveFifty = 50;
  11.    
  12.    Scanner input = new Scanner(System.in);
  13.    
  14.    System.out.println("Input a number between 1 and 100");
  15.    
  16.    numberObtained = input.nextInt();
  17.    
  18.    if (numberObtained = Fifty) {
  19.        System.out.println("Your number equals fifty");
  20.        
  21.    if (numberObtained > aboveFifty) {
  22.       System.out.println("Your number is larger than 50.");
  23.    
  24.     }
  25.     else {
  26.         System.out.println("Your number is smaller than 50.");
  27.  
  28.         }
  29.   }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement