Question
Asked by:
bclimb1983
bclimb1983
Rating : No Rating
Questions Asked: 6
Tutorials Posted: 0
 

$8.00 Simple Java Program

Q:
I need the complete code for the following assingment. The code must be as simple as possible but still cover the entire question, as well as contain comments for explanation of code. Must have code by 12:00pm CST, May 6th

Write a class named TestScores. The class constructor should accept an array of test scores as its argument. The class should have a method that returns the average of the test scores. If any test score in the array is negative or greater that 100, the class should throw an IllegalArgumentException. Demonstrate the class in a program called Scores.
 


   
   
   
   
 
Available Tutorials to this Question
Posted by:
cxxliu
cxxliu
Rating (5): A
Questions Asked: 0
Tutorials Posted: 31, earned $100.78
 

$8.00 Answered

  • This tutorial was purchased 1 time and rated A+ by students like you.
  • Posted on May. 06, 2008 at 02:42:57AM
A:
Preview: ... ttached. ...

The full tutorial is about 6 words long plus attachments.

Attachments:
TestScores.java (0K) (Preview)
Scores.java (1K) (Preview)
Posted by:
portse
portse
Rating : No Rating
Questions Asked: 0
Tutorials Posted: 3, earned $0.00
 

$8.00 Java Scores Solution

  • This tutorial hasn't been purchased yet.
  • Posted on May. 06, 2008 at 04:06:38AM
A:
Preview: ... Code is clean ...

The full tutorial is about 13 words long plus attachments.

Attachments:
Scores.java (0K) (Preview)
TestScores.java (0K) (Preview)
Posted by:
modulo51
modulo51
Rating (110): A-
Questions Asked: 1
Tutorials Posted: 353, earned $2,117.64
 

$7.00 TestScores.java, Scores.java with 3 test cases...

  • This tutorial hasn't been purchased yet.
  • Posted on May 07, 2008 at 1:24:14PM
A:
Preview: ... nt constructor<br><br>// calculate average:<br> public double getAve() throws IllegalArgumentException {<br> try {<br> ave = 0;<br> for (int k = 0; k < objScores.length; k++) {<br> if (objScores[k] < 0) {<br> throw new IllegalArgumentException("Score < 0");<br> } else if (objScores[k] > 100) {<br> throw new IllegalArgumentException("Score > 100");<br> }<br> ave += this.objScores[k];<br> /* if( k%23 == 0 )<br> System.out.println("k,A[k] ...

The full tutorial is about 870 words long plus attachments.

Attachments:
TestScores.java (1K) (Preview)
Scores.java (1K) (Preview)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty