Dylan Stout

Greenhorn
+ Follow
since Sep 04, 2015
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dylan Stout

Knute Snortum wrote:To add elements to the list, use the add() method.



I am somewhat familiar with the add() method, but when I put multiple animals and I type it, it works but this shows up
First here is the code

When I run the program It asks me to input an animal I pic say cat and this is what comes up:

How to do I get it to not show up all the other Not found Animals?
Eventually I will have to make a code that once you Pick an animal it will display information about them
for example:

Ultimately this is something I am trying to get at
I need to store different Animals in an Array Along with information about each animal Stored!
But then I have to have an edit mode on the Main Menu part of my Code which will be number 3. And I have no clue at all how to begin to do that!?
8 years ago
Ok I guess I am a little confused on where my list needs to go?
Where do I put the list so that when I type the the Search for my keyboard matches it from my list?
How do I make an Array list and choose from one of them and where do I store it for newAnimal.get(i).getName() to grab what I typed in? If I had DOG and CAT do I put them in my Animal1 class as an Arraylist or?


Also it is named Animal1 because I was working on another class called Animal and it wasn't working and I was just testing two different things at once basically going back and forth between the two, when I'm all done I will be fixing that and the Spacing in my code.
8 years ago

Campbell Ritchie wrote:Don't use parseInt along with a Scanner. The Scanner can do all the hard work: look for its nextXXX methods.


My reasoning behind using the paresInt is for when you have your choose picking 1-3 (Im going to add more once I get this to work) That if you type anything but a number for that part it System.outprints "Enter a number not a letter.

Paweł Baczyński wrote:Your list is empty so you won't find anything inside it.

Some points about your code:
You need to fix indentation.
What is setName method supposed to do? It takes four parameters and sets the name of Animal1 to the last one. The rest is ignored.
This is how you usually write a setter:Variable names should begin with lower case.



I changed the part for it looks like this now:

when it is run I type in Monkey but it doesn't outprint "
Here is my code for this:
>
8 years ago
When I run my program It works up until it asks for an animal.
I am really stuck on this!
How do I get the type of Animal I type to come up? It just keeps going back to the main menu part.

here is my Animal1 class

8 years ago

Campbell Ritchie wrote:

Dylan Stout wrote: . . .

For better to give the sales person class a proper toString method then you can simply write
System.out.println(grab);
What a strange name to use, grab.



How do you go about in doing this?
8 years ago
Hey mom,
This is just something that I think would help you..
It's not 100% done(and very sloppy) but I think this will give you a little kick start, hopefully..
Didn't get to the incentive or the commission pay or anything really math related.
I just reread through the whole thread and found out about the incentive after I got this to work.
It's not exactly what you need, but I hopes it's a good building block and hope you can understand it.


8 years ago