Results 1 to 2 of 2
  1. #1
    xlactyu is offline Member
    Join Date
    Oct 2014
    Posts
    9
    Rep Power
    0

    Default Getting my program to repeat itself in jGRASP without having to click run

    Basically, I have want to keep typing numbers and pressing enter and the same program keeps repeating itself. This is the code I need to repeat,

    import java.util.Scanner;


    class Averagecalc2
    {
    public static void main(String args [])
    {
    Scanner input = new Scanner(System.in);

    double num,
    num2,
    sum;


    System.out.print("Enter numbers");
    num = input.nextDouble();
    num2 = input.nextDouble();
    sum = (num + num2);
    System.out.println(sum / 2);
    int intnum = (int)num;
    System.out.println(intnum);

    }
    }

    Can someone help

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,991
    Rep Power
    8

    Default Re: Getting my program to repeat itself in jGRASP without having to click run

    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

Similar Threads

  1. Replies: 12
    Last Post: 07-25-2013, 06:55 AM
  2. How to make java program run from a double click.
    By spas87 in forum New To Java
    Replies: 1
    Last Post: 12-14-2011, 05:17 PM
  3. Replies: 1
    Last Post: 10-19-2011, 06:59 AM
  4. Replies: 2
    Last Post: 06-22-2011, 01:19 PM
  5. How do you make program repeat question?
    By dexter in forum New To Java
    Replies: 3
    Last Post: 02-17-2011, 01:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •