Eric Flynn

+ Follow
since Sep 26, 2019
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Eric Flynn

Why can you use an array and not plain variables for looping?
1 week ago
"yo mama's booty" lmao

ok so you cant do like c++


so am i correct in saying that no variables should be available to be manipulated from outside the class, it all needs to be done through methods

it was just a silly example i was experimenting on, nothing serious
1 week ago
i have two classes


and Car:

How come from ShowRoom I can see

public class Car {
   String carColor;
   int doorCount;
   float engineSize;

but i cant see/use String carDescription;

unless I make it public.

1 week ago
Thanks so much,

i will study this and write another program from scratch
1 week ago
ok so i went to the drawing board and started again, same idea, ditched the donuts for a shop with items but its the same idea.

here is my code, im sure you will tell me what is wrong and what must change, i will let you comment first and then I have a few questions, so i havent gone further with it.

Shop Class:

ShopItem Class:

1 week ago
I managed to fix it by going;

is that normal? i never thought I did that in the past, thought sc would just work cause its public.
1 week ago
I have two classes,

and in the class with my main method I have this

but why can none of my methods in the other class see my sc scanner?

1 week ago
will write some tests
2 weeks ago
im busy with

The user is then presented with the main menu

a. Plain donut  £1.99
b. Sugar donut €2.50
c. Chocolate donut €2.99
d. Sprinkled donut €2.99
e. Exit program

and carey has a good point, how can i use name and price from object in a method to loop the menu without physically typing out the menu?

2 weeks ago
ok so i will apply that to the main menu

but i still think i am missing a lot regarding the actual workings of oop as i still dont know where the menu should be placed
it cant be in donut, because every object will then have a menu, which is obviously what i dont want

i understand what you are saying and it does make a lot of sense, i think im missing that "bigger picture" of how things interact
sorry if i cant convey it well to you.
2 weeks ago

I dont think the main menu can be in the donut class, but if its in the main class I have to instantiate an object to use it, i could make it static but i know this is not the way.
2 weeks ago
Ok I get what you saying about the menu display,that can be put in a loop, but that would have to go into a method
callMainMenu or something so that the variables donutName and donutPrice can be fed into the method so that the loop can use these for each donut type

also the welcome line,could that just be put into the main method? or do i need a method for that in the Donut class
welcomeUser for example

This is the problem I am having with design, i just cant work out what goes where and I know objects need to be made from classes, but where do specific responsibilities lie within which classes

for example when objects are created with this code:


is this done in the main method, or somewhere else, it all seems very confusing at this stage

2 weeks ago

"I start out with a small idea that I think will work. Then I write some test code to document what this idea might look like in code. Because there's no production code actually written, the "test code" isn't really test code: when I write it and the way I write it, it's really a specification of what you think is a good way to organize your objects. Once I think I have a good test, i.e. specification, I write the production code to make the test pass. Then I see if I can extend it further by adding some more functionality, again starting with a test to specify how I think the objects in the program should be organized and how they should behave around the new functionality.

Throughout this process, you're always watching out for "code smells" -- things that make working with the code difficult. This is very important because you don't want to keep moving forward with code that's difficult to work with and extend. This is where refactoring comes in. It's a way to head off problems by reorganizing your existing code so that it's easier to work with going forward.

In all my years of developing software, this is the process that has made the most sense to me."

and this

" I would ask myself questions about what somebody using the program might want to achieve. Then I'd ask questions about what kind of information they'd have to provide to the program to achieve that goal. I'd draw out a dialog between the user and the system, kind of like how people producing movies create storyboards so they have a better idea of how they're going to shoot scenes, what it's going look like to the viewer, how the scenes support the plot and form the arc of the story.

When you think about all these high-level ideas first, it helps you see which low-level details are really important. Contrast that with the way you seem to be heading."

is what i took away from that last post

Then I write some test code to document what this idea might look like in code.?

How? im sorry, im just not with you, i seem lost here

2 weeks ago
I'm guessing that I shouldn't even be looking at code...yet
Is this now the time to identify classes members and methods? Or is there something else that needs to be done first?
2 weeks ago
very encouraging words,thank you all! will get right on it tomorrow.
2 weeks ago