
Explanation of Solution
a.
Method heading for each method:
- Method heading for project rating is “public void rateProject()”.
- Method heading for total rating is “public int totalRating()”...
Explanation of Solution
b.
Preconditions and postconditions of each method:
- Precondition and postcondition of “public void rateProject()” method.
- Precondition: None.
- Postcondition: Ratings were attained from user for each category and then assign it to the variable.
- Precondition and postcondition of “totalRating()” method.
- Precondition: None.
- Postcondition: This method returns total rating for each category...
Explanation of Solution
c.
Java statement for testing the class:
//Create an object for "ScienceFairProjectRating" class
ScienceFairProjectRating joesProject = new ScienceFairProjectRating();
ScienceFairProjectRating suesProject = new ScienceFairProjectRating();
//Call "initialize()" method to initialize the variables
joesProject.initialize("Weather and You", "U1256", "Joe Minnow");
suesProject...
Explanation of Solution
d.
Implementation of class:
ScienceFairProjectRating.java:
//Import the java package
import java.util.Scanner;
//Define the class
public class ScienceFairProjectRating
{
//Declare the required variables
private String projectName;
private String identifier;
private String submitter;
//Create an object for "RatingScore" class
private RatingScore creativeRating;
private RatingScore thoughtRating;
private RatingScore thoroughnessRating;
private RatingScore technicalRating;
private RatingScore clarityRating;
//Define the "initialize()" method
public void initialize(String name, String id, String person)
{
//Initialize the required variables
projectName = name;
identifier = id;
submitter = person;
creativeRating = new RatingScore();
thoughtRating = new RatingScore();
thoroughnessRating = new RatingScore();
technicalRating = new RatingScore();
clarityRating = new RatingScore();
creativeRating.initialize("How creative was this project", 30);
thoughtRating.initialize("Was scientific thought displayed in the project", 30);
thoroughnessRating.initialize("Did the project cover the material thoroughly", 15);
technicalRating.initialize("Were appropriate technical skill displayed", 15);
clarityRating.initialize("Was the presentation of the project clear", 10);
}
//Define the "rateProject()" method
public void rateProject()
{
//Display the message to get the rating
System.out.println("Please enter ratings for the project " + projectName + "(" + identifier + ")");
/*Call "inputRating()" method using objects of RatingScore class. */
creativeRating.inputRating();
thoughtRating.inputRating();
thoroughnessRating.inputRating();
technicalRating.inputRating();
clarityRating.inputRating();
}
//Define the "totalRating()" method
public int totalRating()
{
//Calculate the total rating and then return it
return creativeRating.getRating() + thoughtRating.getRating() + thoroughnessRating.getRating() + technicalRating.getRating() + clarityRating.getRating();
}
//Define the "maxRating()" method
public int maxRating()
{
//Calculate the maximum rating and then return it
return creativeRating.getMaxRating() + thoughtRating.getMaxRating() + thoroughnessRating.getMaxRating() + technicalRating.getMaxRating() + clarityRating.getMaxRating();
}
//Define the "getRatingString()" method
public String getRatingString()
{
//Calculate the project rating and then return it
return "Project " + projectName + "(" + identifier + ") by " + submitter + " was given the score "
+ totalRating() + "/" + maxRating();
}
//Define the "main()" method
public static void main(String[] args)
{
/*Create an object for "ScienceFairProjectRating" class. */
ScienceFairProjectRating joesProject = new ScienceFairProjectRating();
ScienceFairProjectRating suesProject = new ScienceFairProjectRating();
/*Call initialize() method to initialize the variables. */
joesProject.initialize("Weather and You", "U1256", "Joe Minnow");
suesProject.initialize("Hot Air", "U1275", "Susan Shark");
//Call "ratePorject()" to rate the project
joesProject.rateProject();
suesProject.rateProject();
System.out.println("Judging is completed: ");
/*Call "getRatingString()" method to get the project rating. */
System.out.println(joesProject.getRatingString());
System.out.println(suesProject.getRatingString());
}
}
RatingScore.java:
//Import the java package
import java.util.Scanner;
//Define the class
public class RatingScore
{
//Declare the required variables
private String description;
private int maximumRating;
private int theRating;
//Define the "initialize()" method
public void initialize(String desc, int max)
{
//Initialize the required variables
description = desc;
maximumRating = max;
theRating = -1;
}
//Define "inputRating()" method
public void inputRating()
{
//Read the maximum rating value from user
System...

Want to see the full answer?
Check out a sample textbook solution
Chapter 5 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
- Which command in the Adjust group allows you to change one picture for another but retain the original picture's size and formatting? Question 17Select one: a. Change Picture b. Replace c. Swap d. Relinkarrow_forwardHow do you insert multiple rows at the same time? Question 10Select one: a. Select the number of rows you want to insert, then use an Insert Control or use the buttons on the Ribbon. b. Click Insert Multiple Rows in the Rows & Columns group. c. Select one row and click the Insert Above or Insert Below button. You will be prompted to choose how many rows to insert. d. You cannot insert multiple rows at the same time.arrow_forwardHow do you center the text vertically in each table cell? Question 9Select one: a. Select the table and click the Distribute Columns button. b. Select the table and click the Center button in the Paragraph group on the Home tab. c. Select the table and click the AutoFit button. d. Click the Select button in the Table group, click Select Table, then click the Align Center Left button in the Alignment group.arrow_forward
- A(n) ____ is a box formed by the intersection of a column and a row. Question 8Select one: a. divider b. table c. border d. cellarrow_forwardA ____ row is the first row of a table that contains the column headings. Question 7Select one: a. header b. primary c. title d. headingarrow_forwardThe Horse table has the following columns: ID - integer, auto increment, primary key RegisteredName - variable-length string Breed - variable-length string Height - decimal number BirthDate - date Delete the following rows: Horse with ID 5 All horses with breed Holsteiner or Paint All horses born before March 13, 2013 To confirm that the deletes are correct, add the SELECT * FROM HORSE; statement.arrow_forward
- Why is Linux popular? What would make someone choose a Linux OS over others? What makes a server? How is a server different from a workstation? What considerations do you have to keep in mind when choosing between physical, hybrid, or virtual server and what are the reasons to choose a virtual installation over the other options?arrow_forwardObjective you will: 1. Implement a Binary Search Tree (BST) from scratch, including the Big Five (Rule of Five) 2. Implement the TreeSort algorithm using a in-order traversal to store sorted elements in a vector. 3. Compare the performance of TreeSort with C++'s std::sort on large datasets. Part 1: Understanding TreeSort How TreeSort Works TreeSort is a comparison-based sorting algorithm that leverages a Binary Search Tree (BST): 1. Insert all elements into a BST (logically sorting them). 2. Traverse the BST in-order to extract elements in sorted order. 3. Store the sorted elements in a vector. Time Complexity Operation Average Case Worst Case (Unbalanced Tree)Insertion 0(1log n) 0 (n)Traversal (Pre-order) 0(n) 0 (n)Overall Complexity 0(n log n) 0(n^2) (degenerated tree) Note: To improve performance, you could use a…arrow_forwardI need help fixing the minor issue where the text isn't in the proper place, and to ensure that the frequency cutoff is at the right place. My code: % Define frequency range for the plot f = logspace(1, 5, 500); % Frequency range from 10 Hz to 100 kHz w = 2 * pi * f; % Angular frequency % Parameters for the filters - let's adjust these to get more reasonable cutoffs R = 1e3; % Resistance in ohms (1 kΩ) C = 1e-6; % Capacitance in farads (1 μF) % For bandpass, we need appropriate L value for desired cutoffs L = 0.1; % Inductance in henries - adjusted for better bandpass response % Calculate cutoff frequencies first to verify they're in desired range f_cutoff_RC = 1 / (2 * pi * R * C); f_resonance = 1 / (2 * pi * sqrt(L * C)); Q_factor = (1/R) * sqrt(L/C); f_lower_cutoff = f_resonance / (sqrt(1 + 1/(4*Q_factor^2)) + 1/(2*Q_factor)); f_upper_cutoff = f_resonance / (sqrt(1 + 1/(4*Q_factor^2)) - 1/(2*Q_factor)); % Transfer functions % Low-pass filter (RC) H_low = 1 ./ (1 + 1i * w *…arrow_forward
- My code is experincing minor issue where the text isn't in the proper place, and to ensure that the frequency cutoff is at the right place. My code: % Define frequency range for the plot f = logspace(1, 5, 500); % Frequency range from 10 Hz to 100 kHz w = 2 * pi * f; % Angular frequency % Parameters for the filters - let's adjust these to get more reasonable cutoffs R = 1e3; % Resistance in ohms (1 kΩ) C = 1e-6; % Capacitance in farads (1 μF) % For bandpass, we need appropriate L value for desired cutoffs L = 0.1; % Inductance in henries - adjusted for better bandpass response % Calculate cutoff frequencies first to verify they're in desired range f_cutoff_RC = 1 / (2 * pi * R * C); f_resonance = 1 / (2 * pi * sqrt(L * C)); Q_factor = (1/R) * sqrt(L/C); f_lower_cutoff = f_resonance / (sqrt(1 + 1/(4*Q_factor^2)) + 1/(2*Q_factor)); f_upper_cutoff = f_resonance / (sqrt(1 + 1/(4*Q_factor^2)) - 1/(2*Q_factor)); % Transfer functions % Low-pass filter (RC) H_low = 1 ./ (1 + 1i * w *…arrow_forwardI would like to know the main features about the following three concepts: 1. Default forwarded 2. WINS Server 3. IP Security (IPSec).arrow_forwardmap the following ER diagram into a relational database schema diagram. you should take into account all the constraints in the ER diagram. Underline the primary key of each relation, and show each foreign key as a directed arrow from the referencing attributes (s) to the referenced relation. NOTE: Need relational database schema diagramarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning




