Search:

Type: Posts; User: melki0795

Search: Search took 0.15 seconds.

  1. Replies
    20
    Views
    1,740

    Re: Rejecting certain inputs

    is it possible to put an array in a method, and have the same recursion call? how would the variable be returned in that case?
  2. Replies
    20
    Views
    1,740

    Re: Rejecting certain inputs

    any ideas?
  3. Replies
    20
    Views
    1,740

    Re: Rejecting certain inputs

    what are the benfits of a loop from a recursive call?

    and any idea how i can apply the same concepts to a array, with 2 outputs?




    double [] homeworkMark = new double[amountAssignment];
    ...
  4. Replies
    20
    Views
    1,740

    Re: Rejecting certain inputs

    it was because of the integer parsing

    Solution




    public static int numberEntered = 0;
    public static int studentNumberEntered(Scanner sc) {
  5. Replies
    20
    Views
    1,740

    Re: Rejecting certain inputs

    public static int studentNumberEntered(int number, Scanner sc) {
    int numberEntered = 0;
    sc.reset();
    try {
    System.out.print("Student Number: ");
    numberEntered =...
  6. Replies
    20
    Views
    1,740

    Re: Rejecting certain inputs

    So this will just let me show an error right? i cannot really loop back... i think
  7. Replies
    20
    Views
    1,740

    Re: Rejecting certain inputs

    Haven't learnt GUI's in Java yet!

    Could you give me an example of what you mean?

    Thanks!
  8. Replies
    20
    Views
    1,740

    Re: Rejecting certain inputs

    If you enter say, a string, the program crashes. Is there a way to control what happens if a different data type is entered?
  9. Replies
    20
    Views
    1,740

    Rejecting certain inputs

    Any ideas of how I could reject character input when i ask the user for an integer?
    Example

    If i want him to enter age... It won;t let him spell it out with characters.

    Best Regards

    ---...
Results 1 to 9 of 9