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
Write a function that accepts an argument for a persons name. The method should loop through the number of characters in the nam
MatroZZZ [7]

Answer:

#include <iostream>

#include<string.h>

using namespace std;

void printCharacter(string name){

   for(int i=0;name[i]!='\0';i++){

       cout<<name[i]<<endl;

   }

}

int main()

{

   string name;

   cout<<"enter the name: ";

   cin>>name;

   printCharacter(name);

}

Explanation:

first include the two libraries iostream for input/output and string library for using the string.

then, create the main function and declare the variable type string.

cout instruction is used o display the message on the screen.

cin is used to store the value in the name variable.

after that, call the function. The program control move to the the function. In the function for loop is used to print the character one by one until end of the name.

4 0
3 years ago
The 8086 was divided into two main parts. The _____ was the "brain" of the processor, and had the ALU, general-purpose register,
jonny [76]

Answer:

1.Execution Unit.  2.Bus interface unit

Explanation:

3 0
3 years ago
Personal computer is the rise of what?​
gogolik [260]

Answer:

Overuse injuries of the hand.

Obesity.

Muscle and joint problems.

Eyestrain.

Behavioural problems including aggressive behaviour.

6 0
2 years ago
21
n200080 [17]

Answer:

slide sorter view

Explanation:

Explanation: while you can use 3/4 of these options to reorder slides, it is more common to use slide sorter view.

8 0
2 years ago
Which education level has the highest return on investment (ROI)? AHigh School Diploma BROI is equal for all of the above. CSeni
KonstantinChe [14]
A is the best choice , because if you dont graduate high school , there is no chance you can be anything 
6 0
3 years ago
Other questions:
  • Cleaning the keyboard is the most important part of keeping your computer running at peak performance.
    5·2 answers
  • Spreadsheet software creates a ____, composed of a grid of columns and rows
    6·1 answer
  • What is the slide sorter view used for?
    11·1 answer
  • When you write a C# program that stores a value in a variable, you are using temporary storage; the value you store is lost when
    12·1 answer
  • What do you call a set of programs?
    7·1 answer
  • If there is a circuit that is being used 36 CCS then how much of that circuit is being used in Erlang?
    8·1 answer
  • Can you get financial aid with average grades
    15·1 answer
  • What happens when a computer gets a virus?
    6·2 answers
  • Which of the following describe audio-editing software? Choose all that apply.
    5·2 answers
  • ravi met few peoples in a party and was mixing up well those wearing expensives clothing and fair complexion . which factors are
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!