Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Programming (https://www.askmehelpdesk.com/forumdisplay.php?f=437)
-   -   Program that takes a number from the user and verifies that it's between 7 and 11? (https://www.askmehelpdesk.com/showthread.php?t=803897)

  • Nov 1, 2014, 10:41 PM
    lostperson19999
    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");
    }
    }

  • All times are GMT -7. The time now is 12:53 AM.