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]
3 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]3 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
A ____________ is a collection of infected IT devices that an attacker or attack group controls.
sattari [20]
The answer would be a Botnet .
8 0
2 years ago
What's the full form of CPU?​
Bas_tet [7]

Answer:

Central processing unit

5 0
3 years ago
Read 2 more answers
What functionality can a vulnerability scanner provide that a port scanner cannot?
Rina8888 [55]
<span>Sending alerts when new systems are added to the network is the functionality that a vulnerability scanner can provide and a port scanner cannot.
</span>port scanner<span> allows testing of open </span>ports and firewalls. It d<span>iscovers open UDP </span>ports<span> on your target system by </span>scanning with NMAP and by doing so it is<span> the first step of a complete </span>vulnerability<span> assessment. </span>
7 0
3 years ago
20
denis-greek [22]

Answer:

true

Explanation:

because my 8 ball said so

6 0
4 years ago
April 107 90 29 31 66 0.344
Misha Larkins [42]

Answer:

Check the explanation

Explanation:

with open('stats. txt', 'r') as   # open the file in read mode

   list1 = []   # initialize an empty list

   for i in  . readlines ():  # read every line of file

       for j in i. split ():  # split each line by a space and append it to the list1

           list1. append (j)

   months = [] # initialize required lists to empty list

plate_apperence = []

at_bats = []

runs = []

hits = []

total_bats = []

for i in range(0, len(list1)-1, 7): # use a for loop and give parameters as start,stop and step count

months. append(list1[i]) # append list1 elements to required lists

plate_apperence. append(int(list1[i+1]))

at_bats. append(int(list1[i+2]))

runs. append(int(list1[i+3]))

hits. append(int(list1[i+4]))

total_bats. append(int(list1[i+5]))

for i in range(len(months)): # for each element in months

print("Player's Average Batting and slugging percent for the month ", months[i], " is as shown below")

print("{:.2f}".format(hits[i]/at_bats[i])) # calculate Average batting and slugging percent and print them

print("{:.2f}". format(total_bats[i]/at_bats[i]))

print("\n")

Kindly check the attached images below to get the Code Screenshot and Code Output.

3 0
3 years ago
Other questions:
  • You have been found at fault in a crash where someone was injured and was transported to a medical treatment facility. By law yo
    15·2 answers
  • In Labrador retrievers, black coats are dominant and brown coats are recessive. What is the genotype of a brown Labrador?
    5·1 answer
  • The audience for your security assessment report (SAR) is the leadership of your company, which is made up of technical and nont
    6·1 answer
  • Which technological innovation was most important for early-nineteenth-century economic development?
    11·1 answer
  • PLS HELP IMEDIATELY!!!!!
    15·2 answers
  • How do I fix this? It stopped adding up my points when i did one of the challenges.
    11·2 answers
  • Can someone help me?
    7·2 answers
  • State the domain and range for the following relation. Then determine whether the relation represents a function. A box labeled
    6·1 answer
  • FS EVERFI:
    7·2 answers
  • Which term means a cryptography mechanism that hides secret communications within various forms of data?.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!