onsider a class ScienceFairProjectRating that will be used to help judge a science fair project. It will use the class RatingScore described in the previous exercise. The attributes for the new class are

• The name of the project
• A unique identification string for the project
• The name of the person
• A rating for the creative ability (max. 30)
• A rating for the scientific thought (max. 30)
• A rating for thoroughness (max. 15)
• A rating for technical skills (max. 15)
• A rating for clarity (max. 10)
It will have methods to
• Get the number of judges
• Get all the ratings for a particular project
• Return the total of the ratings for a particular project
• Return the maximum total rating possible
• Return a string showing a project’s rating in a format suitable for display
a. Write a method heading for each method.
b. Write preconditions and postconditions for each method.
c. Write some Java statements that test the class.
d. Implement the class.

a) ```
public void rateProject()
public int totalRating()
public int maxRating()
public String getRatingString()
```

b)
public void rateProject()
Precondition: none.
Postcondition: Ratings were obtained from the user for each category and then set.

public int totalRating()
Precondition: none.
Postcondition: The total of the ratings in each category was returned.

public int maxRating()
Precondition: none.
Postcondition: The maximum possible total rating over all categories was returned.

public String getRatingString()
Precondition: none.
Postcondition: A string in a nice format that shows the rating of the project.

c&d)
See the code in ScienceFairProjectRating.java.

Computer Science & Information Technology

You might also like to view...

Match the following key(s) to their function:

I. Ctrl + X II. Ctrl + V III. Esc IV. Tab V. Shift + Enter A. paste text or object B. move to the next cell of a table C. cut text or object D. return to Normal view after Show Show view E. insert a manual line break

Computer Science & Information Technology

The Information Bar will display at the top of the screen under which of the following conditions?

A) You started Internet Explorer with add-ons enabled. B) Your security settings are below the recommended level. C) A Temporary Internet file is placed on your computer. D) A site tries to download a file to your computer.

Computer Science & Information Technology