1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mixas84 [53]
2 years ago
9

Design a TestScores class that has fields to hold three test scores. The class should have a constructor, accessor and mutator m

ethods for the test score fields, and a method that returns the average of the test scores. Demonstrate the class by writing a separate program that creates an instance of the class. The program should ask the user to enter three test scores, which are stored in the TestScores object. Then the program should display the average of the scores, as reported by the TestScores object.
Computers and Technology
1 answer:
sweet-ann [11.9K]2 years ago
6 0

Answer:

Answered below

Explanation:

class TestScores {

double test1;

double test2;

double test 3;

public TestScores (double test1, double test2, double teat3){

this.test1= test1;

this.test2 = test2;

this.test3 = teat3;}

//mutator

public setTest1(double test1){

this.test1 = test1;

}

//accessor

public double getTest1(){

return test 1;

}

//Write same accessors and mutators for test2 and test3

public double getTestAverage(){

double sum = test1+test2+test3;

return sum / 3;

}

}

class TestRun{

public static void main (String [] args){

TestScores scores = new TestScores(50.5, 40.0, 80.7)

int average = scores.getTestAverage();

System.out.print(average);

}

You might be interested in
Fill in the blanks to make the factorial function return the factorial of n. Then, print the first 10 factorials (from 0 to 9) w
nadezda [96]

Answer:

Following are code of factorial in python language

def factorial(n): # function

   result=1 #variable

   for x in range(2,n+1): #iterating the loop

       result=result*x  #storing result

   return result #return result

for n in range(10): #iterating loop

   print(n,factorial(n)) #print factorial

Output:

Following are the attachment of output

Explanation:

Missing information :

In the question the information is missing the code is missing which we have to correct it following are the code that are mention below.

def factorial(n): # function

   result=1 #variable

   for x in range(       ): #iterating the loop

       result=  #storing result

   return  #return result

for n in range(  ): #iterating loop

   print(n,factorial(n)) #print factorial

Following are the description of code

  • We have create a function factorial  in this we have pass the one parameter i.e "n".
  • In the for loop we have pass 2,n+1 which has been used to iterating the loop calculating factorial and string the result in the result variable
  • In the main function we have pass the range on which we have to calculated the factorial
  • Finally the print function will print the factorial .

Following are the attachment snip of code in the python language

3 0
3 years ago
9. Select the correct answer.
mihalych1998 [28]

Answer:

I believe the answer is exclusive but im not 100% sure

5 0
3 years ago
What are some of the challenges that could arise from setting up a file management system on a computer?
son4ous [18]
It could glitch out or be hacked or deleted.
8 0
3 years ago
What is workflow? how do you create your own workflow?
lana66690 [7]
A workflow consists of an orchestrated and repeatable pattern of business activity enabled by the systematic organization of resources into processes that transform materials, provide services, or process information.


Create a detailed outline of what you want to achieve and sketch a workflow diagram before using workflow chart software or templates. This will help to ensure your chart is accurate and complete. Always consider your process and workflow manageability when inserting logic in your workflow chart. You can use decision symbols, connectors and text boxes. Always confirm the accuracy of your workflow chart with other stakeholders.


(If you need to know what the workflow diagrams layout is just look it up. GL.)
6 0
3 years ago
Select the correct answer.
irinina [24]

Answer:

A

Explanation:

6 0
3 years ago
Other questions:
  • What operating system was most commonly used by early personal computers? Apple Mac MS-DOS Windows
    6·2 answers
  • You want to join your computer to a homegroup but you don't see any homegroups on your home network
    11·1 answer
  • How do you change your age on here? I accidentally put that i was 15 but i am only 13. How do I change this?
    12·1 answer
  • A(n) _____ is money paid for work.<br><br> A. raise <br> B. allowance<br> C. wage<br> D. grant
    14·2 answers
  • Write a program named as calcPrice.c that formats product information entered by the user and calculate the total amount of purc
    5·1 answer
  • Differentiate Between register and Memory location (
    13·1 answer
  • Look at the network topology. What will happen with the other computers if the computer breaks at the RED X?
    8·1 answer
  • Write a method called removeHighPrice that will go through a provided ArrayList called prices and removes the first price that i
    6·1 answer
  • Why would you use a computer's secondary memory?
    12·1 answer
  • Uh can somebody help me
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!