subject

Part 1. Create a class GradedActivity that has two attributes: score and weight (both doubles). Supply a constructor that allows one to set both the score and weight, AND one that allows one to set just the weight (in which case the score defaults to 0). Provide get and set methods: enforce the restriction that the grade must be between 0 and 100 (inclusive) and the weight must be between 0 and 1 (exclusive); if either is not within range, throw an exception. In addition supply a toString method and a method, getGrade( ) that returns a char: A, B, C, D, F; use the usual meaning of these grades and round up any grades that are nn.5 or higher.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
How can a user open a blank presentation? 1.on the file menu, click new, and then click recent templates 2.on the file menu, click new, and then click blank presentation 3. on the view menu, click templates, and then click recent templates 4. on the view menu, click samples, and then click blank presentation
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
Technician a says that a shop towel should never be used to clean around the flange area before replacing an automatic transmission filter. technician b says that a dimpled transmission fluid pan can be repaired. who is right
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
Martha is designing a single-player game. her manager suggests that she plan the design to incorporate future modifications. which principle of game design relates to planning for future modifications?
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
You know the right answer?
Part 1. Create a class GradedActivity that has two attributes: score and weight (both doubles). Supp...
Questions
question
Mathematics, 26.02.2021 23:40