Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the UML for the TestScore class below with the proper fields/attributes in the second row, getters and setters methods in the third row. TestScore

Complete the UML for the TestScore class below with the proper fields/attributes in the second row, getters and setters methods in the third row.

TestScore

- score1: double

-

-

+

+setScore1(n: double): void

+

+

+getScore1(): double

+

+

+

In the second row, all fields or attributes for this course are private, - score1: double

NOTE: Please do not write an Java code in UML.

Please write the other two fields in second row.

In the third row, write all members here, member are setters/mutators and getters/assessors methods.

NOTE: The first method is default to as constructor method. Please write a TestScore constructor method as the first method with an arguments: double datatype for s1, s2 and s3, then in the body of this method, assign each parameter to the appropriate field.

Write all eight methods in the above UML, in addition the constructor and getAverage() methods. You will need to write three setters and three getters methods for each of the fields. All methods for this course are public +

Using NotePad, create the TestScore class, save as TestScore.java and compile to generate the TestScore.class file.

public class TestScores

{

//write your fields here for testScore1, testScore2, testScore3 with proper datatype

/**

* Constructor

*/

public TestScores()

{

}

//---------------------------------------------------------------------------------------------------------------->

// write all setters methods for setTestScore1, setTestScore2 and setTestScore3 methods below:

//---------------------------------------------------------------------------------------------------------------->

//---------------------------------------------------------------------------------------------------------------->

// write all getters methods for getTestScore1, getTestScore2 and getTestScore3 methods below:

//---------------------------------------------------------------------------------------------------------------->

//---------------------------------------------------------------------------------------------------------------->

// write getAverage method here

//---------------------------------------------------------------------------------------------------------------->

//---------------------------------------------------------------------------------------------------------------->

// write getLetterGrade method here

//---------------------------------------------------------------------------------------------------------------->

public char getLetterGrade()

{

//declare your grade as char and average as double datatypes here

//call the getAverage method and assign to a average here

//use if/else structure for ranges, starting with upper boundaries, use logical and relation operators

//to avoid nesting of loops.

}

}

Using NotePad, create the TestScoreDemo.java to instantiate the Employee objects for test1, test2, and test3.

// Needed for the Scanner class

public class TestScoresDemo

{

public static void main(String[] args)

{

// Test score #1

// Test score #2

// Test score #3

// Create a Scanner object for keyboard input.

// Get three test scores from the user.

// Create a TestScores object initialized

// with the three test scores.

// Display the test scores.

// Display the average test score.

// Display the letter grade.

}

}

Compile the TestScoreDemo.java to TestScoreDemo.class and take screen shot of output (Ctrl + Alt + PrtScn) and paste (Ctrl + V) below:

Files include in this directory is TestScore.java, TestScore.java, and both .class files, and this document.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems

Authors: Carlo Zaniolo, Stefano Ceri, Christos Faloutsos, Richard T. Snodgrass, V.S. Subrahmanian, Roberto Zicari

1st Edition

155860443X, 978-1558604438

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago