Search:

Type: Posts; User: sunny9372

Search: Search took 1.02 seconds.

  1. Re: Default constructor generating random questions

    We can use if/else statements, but how would I go about doing that in the constructor?

    --- Update ---

    Just so you know, I've only been programming for 2 months, so feel free to elaborate as...
  2. Re: Default constructor generating random questions

    We aren't allowed to use arrays, I was thinking maybe a for loop but I don't how I'd go about that.
  3. Re: Default constructor generating random questions

    Okay I fixed the problem with the variables. So far I have created the equation to add the two numbers, not subtraction. Also, I don't understand how I can tell my program to choose a random...
  4. Re: Default constructor generating random questions

    Ok, I altered the Question class I posted, it should be able to compile without any problems. If not I'll paste the entire text. And I attempted to see what was wrong, the only problem I see right...
  5. Re: Default constructor generating random questions

    Okay, the thing is I'm assigning the instance variables in the constructor and the constructor is automatically assigning the value of num1 as 6 and num2 as 0. Just browse my initial code to tell me...
  6. Re: Default constructor generating random questions

    I see where the values are given in, it takes the num1 and num2 values declared in the constructor, what I'm not understanding is why I'm getting 6-0 as my only values and better yet, how do I ensure...
  7. Re: Default constructor generating random questions

    I am actually calling my constructor and the toString method in an another application class not in the programmer defined class.



    package project4;

    public class Project4App
    {
    public...
  8. Default constructor generating random questions

    Need to create a default constructor that generates a random question, addition or subtraction. And when adding the numbers must be random from 0-12 and when subtracting the first number must be from...
Results 1 to 8 of 10