beverly Azanbou

Greenhorn
+ Follow
since Nov 23, 2012
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 beverly Azanbou

I agree with you guys a 100% but I am just not sure where to start and how to do that.
I have only be writing code for like 23 days... so this is still very new to me.
Any help in the form of code samples and examples will be greatly appreciated.
11 years ago

Campbell Ritchie wrote:Welcome to the Ranch

I am sorry to tell you, but you should get rid of the frame. And the windows. Ditch the GUI entirely … at least for the time being. What you should do, is get that application working as a console application. Get your tutoring class working, with lots of methods which allow you to enter time, get charges, etc. Get that working so you can call it from another class’ methods and print out the results on the command line/terminal. Then you can create a GUI to go on top of that.
Don’t put any application code in the GUI. The GUI calls the app and displays it. It does not do any arithmetic, recording, etc.
You have been told you have a 2D array, but you ain’t, because there ain’t no such critter. Note cowpoke grammar used on the Ranch What you have is an array or arrays, which is different from a 2D array, and better.
But why are you using arrays like that? Why don’t you have a TutorSession class which encapsulates the time and cost? You can even have a per‑hour field in that class, which allows it to do the arithmetic for you. You can have a Tutor class which has a TutorSession[] as a field. You can even fiddle things so you can get the first session by entering 1 and find sessions[0].

You should also go through the Java Tutorials and read about text components. Some of them support multiple lines and some only support a single line.



My class assignment required that I use GUI.
I had actually created a 2 array that ran very will on its own, then I cut snippets of that and added it to the Jframe.
I don't see how I can get lots of methods when I need to fill and 2D array or and array of arrays like so:
TUTORING TIME(mins) AMOUNT EARNED($)
67 40
89 67
78 73

can you please explain how to do that?
How do I encapsulate the time and cost in a class and create separate methods that come together as a 2D array or array of arrays( I am not sure what the difference is between those two albeit all the research I have been doing online) .
This is the code for the 2 D array i wrote before I immersed it in the netBeans JFrame:
>
11 years ago
Hi guys,
I am new to java and I have a class assignment.
So here it goes.
The assignment consist of filling a 2D array with user input.
The inputs are tutoring time and amount earned.
I have build the array but I have two questions:

1.) I am not able to get the numbers to print successcively,
when the user inputs some new values, the ones before that disappear from the text area.
I tried the append thing and created a for loop to go with , but still it won't do print out the previous values after I hit the enter key.

2.)How do I get the average for such and array with user input.My question is I am not sure where and how to create the counter for this array.

Last question, do you guys think my code is appropriate for building a 2D array?

These are some snippets of the code I have come up with so far.
11 years ago