Ok...I'll consider and work through the questions you asked...maybe that will help I can certainly leave as is and when I run the file see what happens...Thx for your help Norm
Type: Posts; User: Vessel06
Ok...I'll consider and work through the questions you asked...maybe that will help I can certainly leave as is and when I run the file see what happens...Thx for your help Norm
I think that's what we need to figure out lol...I have the all the other classes since the basis of the lesson is inheritance and how they work and what not. I have my passed method in another class...
The IDEA of the code is to override totalCredits so that only credits from classes the student passed are counted...I think I need an if statement since it's a conditional right? I already have my...
no the output isn't missing...I don't think anyway...I just wanted to make sure that the IDEA behind the coding is correct lol...I like to plan ahead you know lol
I'm doing an assignment that has multiple classes that inherit from one another. That part I get, and the majority of my code is correct as I spoke to my prof and went over what I had at the time. ...
Oooooooooh!!!!! THANK YOU!!!! THAT MAKES SENSE!!!!! I was totally missing that part! So it should be
String[] w = {"James Bond", "Nemo", "Capt America"};
chooserList[0] = new...
To put all the Strings into a String array (the one I've already created that takes a String[]) how do I do that? I know this
chooserList[0].Add(["James Bond", "Nemo", "Capt America"]);
...
I did post the error...I'll shorten it lol
/*write a program that creates an array of four MadChoosers, chooserList.
* chooserList[0] will be used to hold proper names, chooserList[1]...
Yeah sorry abt that...I spoke with my professor today and have corrected the coding...but I am running into another problem with the chooserList class...here is the revised code
public class...
I'm doing an assignment that's a separate class for a program called "MadChoosers" and THIS class creates an array of four MadChoosers called chooserList and the four chooserList arrays are...
:confused:
I'm having a problem with one part of this assignment, the instruction is this "Add a method transaction which takes two int parameters, daynum and amount. daynum is the day of the...
This is the current code giving the issue
G1.setPet(C2);
G2.setPet(C1);
System.out.println(G1.getPet().getGname);
The output I'm getting is " The Gorilla's name...
Ok...this is the prof's example/instruction "In your harness, check that your new accessor and mutator work. For instance, if you have a Gorilla koko and a Cat fluffy, you should be able to say
...
YOU SIR ROCK!!!! I passed in the right identifier
public void setPet(Cat c) {
this.pet = c;
}
Now the problem is to make sure it all runs in the harness when I give the...
But when I simply put
public void setPet(c) {
this.pet = c; //this is the error
}
Java gives another error stating that an identifier still needs to be made...unsure what I...
Is this what you meant?
public void setPet(String Cat) {
this.pet = Cat;
}
Because if so, Java gives and error stating "incompatible types required: Cat found: String"
---...
No I didn't change any of the variables
Ok that makes more sense but does it make a difference that the variable is like that because it's supposed to call on the cat class that is already written and correct since my prof checked it...
the setPet method in particular. maybe i'm misunderstanding the way the mutator works but I figured that
public void setPet (String c) {
this.pet = c;
should work....but for some reason...
ok same assignment(discussed in the question abt mutators) new problem, in my class gorilla, we have to give it a pet cat with the accessors and mutators for the pet cat in the gorilla class... this...
But when I type
public void setGweight(int x) {
if (x != -0) {
return false; //error reads saying: cannot return a value from method whose result type is void--Unnecessary return...
You know what...I totally forgot abt using an if statement! lol But she didn't say what the code is supposed to do if it detects a negative number, but to make sure that it CAN'T be a negative number...
:confused:
So this is a hw assignment and I'm having a little trouble with it. I am a beginner (first programming class EVER) but I'm a quick learner so bare with me lol :-)
The assignment is...