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...
Type: Posts; User: sunny9372
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...
We aren't allowed to use arrays, I was thinking maybe a for loop but I don't how I'd go about that.
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...
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...
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...
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...
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...
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...