Ask Experts Questions for FREE Help !
Ask
    lostperson19999's Avatar
    lostperson19999 Posts: 1, Reputation: 1
    New Member
     
    #1

    Nov 1, 2014, 10:41 PM
    Program that takes a number from the user and verifies that it's between 7 and 11?
    That's really it... I have tried doing this but I am really not familiar with java. Any help is appreciated.

    import java.util.Scanner;


    public class assignment8 {


    Scanner in = new Scanner(System.in);

    public static void main(String[] args){

    System.out.print("Please enter a number ");
    Integer item1 = in.nextInt();

    int value1 = 7;
    int value2 = 11;

    if(value1 == value2)
    System.out.println("value1 == value2");
    if(value1 != value2)
    System.out.println("value1 != value2");
    if(value1 > value2)
    System.out.println("value1 > value2");
    if(value1 < value2)
    System.out.println("value1 < value2");
    if(value1 <= value2)
    System.out.println("value1 <= value2");
    }
    }

Check out some similar questions!

Write the program that lets the user play the game [ 0 Answers ]

Write the program that lets the user play the game of rock , paper , and scissors against the computer the program should work as follows: 1.when the program begins, a random number in the range of 1 through 3 is generated . If the number is 1, then the computer has chosen rock . If the number...

Computor takes a long time get to user log on [ 2 Answers ]

Rebuilt a PC using XP and all the drivers. On swt on it takes an age to get past the first windows loading screen, than another while to get past loading windows. I've defragged and run XP in repair mode but it still takes ages to get to the user log on screen. It also takes an age to close...

Program PC Center ran in a user area on startup, not working now. [ 2 Answers ]

A program called PC Center ran on startup in one of the user areas on my PC, Vista 64. It seemed to do a scan and when it finished, I closed it and the user area went blank and now will not come up. The other user is OK - can't find the exe - PC.exe. Not really sure what info to give, the second...

Interactive C++ program that inputs a series of 12 temperatures from the user. [ 2 Answers ]

Interactive C++ program that inputs a series of 12 temperatures from the user.


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.