JeffreyAaron Smith

Greenhorn
+ Follow
since Jan 26, 2013
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 JeffreyAaron Smith

Because this is a project for a class with very specific requirements. For instance the driven class portion of the program must be named, "Date.java" and the driver named "LastnameFirstnameDateDriver.java". It also must include a Date constructor that receives a string called dateStr. It must error check the input using try/catch.

Unfortunately now I've been error checking, rewriting, adding, deleting for so long now, I'm not sure where I'm at...looking over the code, I suspect I have complicated it more than it needs to be.

I'm sorry to be asking, but can you help look through my code and streamline/debug?
11 years ago
I've been working on a pair of programs (driver and driven) that will accept input in the form of numbers a slash mark and numbers, which represent the month and day. The program error checks the input for valid numbers and then prints a line with the numbers as entered (mm/dd) and with the month spelled out (Month dd). Unfortunately, my code is somehow reversing the value for the date (i.e. 02/05=May 2).

I'm sure this is something simple I'm overlooking, but I've been scouring this code all day and can't find it. Any help would be greatly appreciated.

The driver:


And the driven class:

11 years ago
Please forgive me ignorance, but I'm pulling my hair out...and I don't have much left.

The errors I'm getting are:

40: error: bad operand types for binary operator '/'
gradePoints = (earnedPoints / possiblePoints);
^
first type: int[]
second type: int[]
47: error: bad operand types for binary operator '<'
if (gradePoints < .60)
^
first type: double[]
second type: double
49: error: bad operand types for binary operator '>='
else if (gradePoints >= .60 && gradePoints < .70)
^
first type: double[]
second type: double
49: error: bad operand types for binary operator '<'
else if (gradePoints >= .60 && gradePoints < .70)
^
first type: double[]
second type: double
51: error: bad operand types for binary operator '>='
else if (gradePoints >= .70 && gradePoints < .80)
^
first type: double[]
second type: double
51: error: bad operand types for binary operator '<'
else if (gradePoints >= .70 && gradePoints < .80)
^
first type: double[]
second type: double
53: error: bad operand types for binary operator '>='
else if (gradePoints >= .80 && gradePoints < .90)
^
first type: double[]
second type: double
53: error: bad operand types for binary operator '<'
else if (gradePoints >= .80 && gradePoints < .90)
^
first type: double[]
second type: double
55: error: bad operand types for binary operator '>='
else if (gradePoints >= .90 && gradePoints <= 1.00)
^
first type: double[]
second type: double
55: error: bad operand types for binary operator '<='
else if (gradePoints >= .90 && gradePoints <= 1.00)
^
first type: double[]
second type: double
57: error: cannot return a value from method whose result type is void
return getLetterGrade;
^
67: error: method getLetterGrade in class JSHwScore cannot be applied to given types;
+ possiblePoints + " possible points: " + getLetterGrade(earnedPoints), possiblePoints);
^
required: double,double
found: int[]
reason: actual and formal argument lists differ in length
12 errors

Tool completed with exit code 1


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


The java code is:



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


Any help you can give would be greatly appreciated.
11 years ago