Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a program that will allow you to enter a mark, from 1 to 100,
- // It will tell you whether your number is equal to fifty, larger than fifty or smaller than fifty
- import java.util.Scanner;
- class or_else_program {
- public static void main(String[] args) {
- int numberObtained, aboveFifty;
- aboveFifty = 50;
- Scanner input = new Scanner(System.in);
- System.out.println("Input a number between 1 and 100");
- numberObtained = input.nextInt();
- if (numberObtained = Fifty) {
- System.out.println("Your number equals fifty");
- if (numberObtained > aboveFifty) {
- System.out.println("Your number is larger than 50.");
- }
- else {
- System.out.println("Your number is smaller than 50.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement