Chris Hathaway

Greenhorn
+ Follow
since Feb 08, 2012
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chris Hathaway

agreed i apologize!

Basically im supposed to be creating a class to model a student, and a couple of test grades,

this is what she put on the description for the project
Part I:
Write a program Student.java to model a college student and test each method in StudentTest.java.

Part II:
Add studentID to Student.java to describe a college student id number, a unique number.
Therefore, each student is created with a name, an id, 0 for both test one and test two.
A studentID should be read-only, it must be generated in the constructor.
A method getStudentID() should be provided to allow an access to a student id.

Let me know if I wasnt clear enough, or if you want any specific details or such.

10 years ago
I dont really get how I am supposed to be doing this, my teacher mentioned writing two different programs at the same time.

Was wondering if you all could throw out some pointers, or maybe some basic tips that would get me in the right direction.
10 years ago
Ok I did some messing around and i got it to display the letter, but now its just displaying the wrong letter grade

heres what i added!
---------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------
10 years ago
Hello again Javaranch!

I am currently working on a project that asks the user to enter in two test grades for four different students, once you have the test grades, it gives you the average of both of the students test grades, followed by a letter grade to correspond to it.
I have everything working except for the letter grade part!!! I cant figure out how to make it present a letter grade(A, B, C, D, F) based on the average of both test scores.

Here is my code so far!
Please explain your reasoning behind your logic!!!

------------------------------------------------------------------------------------------------------------------------------------------------------



--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10 years ago
Well I got to theory crafting and started trying random stuff, I put the whole code, give or take a few brackets, in a do - while loop, and made sure the "Int choice = 0;" was outside the loop, final code looks like this...

I remember you saying
1. that you doubted the design of a do - while switch that exits from inside itself
2. that my main method was way too long, and alot of repeated code.

Do you think you could elaborate for future reference? Would be very helpful

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10 years ago
Thanks for all your help! Ended up figuring it out myself!
10 years ago
Hi again Java Ranch!

Im currently working on a project that lets you add, subtract, multipy, or divide 2 integers, and then gives you the answer

I wanted to put a while or do-while switch on it so that when you get your answer,
it restarts itself and prompts you to pick which operand you want and which two integers to be used, but I havent been
able to figure it out.

Help and suggestions would be great! Please explain your logic behind your reasoning!

Here is my code so far!

--------------------------------------------------------------------------------------------------------------------------------------------------


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
10 years ago
Hi, I am currently developing a program that will allow you to enter in two dates and it will tell you the difference between them. Im currently having problems getting the months to properly work, the way I want it to work is that the user enters in the month(such as january or april) for each date, and a year for each date(such as 2012 or 1776). The year difference works fine, but for the months I cant seem to figure it out, any help would be greatly appreciated! Here is my code so far!
-----------------------------------------------------------------------------------------



-----------------------------------------------------------------------------------------

10 years ago
Thanks to all whi helped! Figured it out, just removed Line from nextLine, works perfectly now
10 years ago
I get the logic i guess, I still don`t see why i wouldnt have the same problem for the first section.
10 years ago
so then why does it work for the 1st section of code and not the second? Im having trouble getting what your saying lol
10 years ago
im making a program that compares the dates and tells you how far apart they are timewise. im having a small problem at the moment thought...

here is part of my code:

------------------------------------------------------------------------------------------------------



--------------------------------------------------------------------------------
what it should do is

1. print "For the first date..."
then "enter month:" right under it

2. wait for user input

3. print "Enter year:"

4. wait for input

but on the second section of code, where it uses monthnumbertwo and yearnumbertwo, its displaying "Enter Year:" and "Enter Month:" at the same time. I have no idea what the problem is...
10 years ago
thank you very much it worked perfectly, but I was wondering if you could explain your thinking, just for notes and future reference!
10 years ago
Your right thats what my code does at the moment.

What I need it to do is to update the remaining balance

like say I use $47.63, which was the teachers example, she got back

4 ten dollar bills
1 five dollar bills
2 one dollar bills
2 quarters
1 dimes
0 nickels
3 pennies

I dont think my code is updating the remaining balance, its still just dividing $63.97, thus giving me values like 6397 pennies

10 years ago