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
klasskru [66]
2 years ago
12

Create a structure representing a student. The member variables should include student name, student ID, and four test grades fo

r the student (an array of four grades as a member variable). Prompt the user to enter the name, ID, and the four positive test results. Perform error checking for negative values. Store all the data in a structure object. Calculate the average of the three highest grades, dropping the lowest grade. Display the student's name, ID number, four test grades, and the average of the three highest grades. Use a loop to repeat the questions for the next student. You can recycle the same struct object for the next student. Terminate the program when the user decides to stop.
Computers and Technology
1 answer:
Neporo4naja [7]2 years ago
6 0

Answer:

Output:

Name: Brainly

ID:0001

Write the 4 tests grades of the student separated by space :10 9 8 10

Brainly

0001

10 9 8 10

Average :9.66667

'1' to continue '0' to exit :

Explanation:

#include<iostream>

#include<string>

using namespace std;

//variables declaration

struct Student {

  string id; //string declaration ID

  string name; // string declaration name

  int grades[4]; //array of 4 because it is 4 grades

};

//definition of the function get information

void inputData(Student &s){

 

   

   cout << "Name:" ;

   getline(cin,s.name);

   cout << "ID:";

   cin >> s.id;

   cout << "Write the 4 tests grades of the student separated by space :";

   for (int i = 0; i<4; i++)

       cin >> s.grades[i];

}

//definition of the function of average

double inputAvg(Student s){

   double summation;

   int temporary;

   double average;

   for (int i = 0; i<4; i++){  

      for (int j = i; j<4; j++){

         if (s.grades[j] > s.grades[i]){

             temporary = s.grades[i];

             s.grades[i] = s.grades[j];

             s.grades[j] = temporary;

         }

      }

    }

    summation = 0;

    for (int i = 0; i<3; i++){

        summation = summation + s.grades[i];  

    }

    average = summation/3;

    return average;

}

void disp(Student *s){

   cout << s->name << endl;

   cout << s->id << endl;

   for (int i = 0; i<4; i++)

       cout << s->grades[i] << " ";

   cout << endl;

   cout << "Average :" << inputAvg(*s) << endl;

   

}

int main(){

  Student st;

  int ch;

  while(true){

      inputData(st);

      disp(&st);

      cout << " '1' to continue '0' to exit :";

      cin >> ch;

      if (ch == 0)

         break;      

  }

  return 0;

}

You might be interested in
_____ is the practice of using the internet to provide healthcare without going to a doctor’s office or hospital.
Molodets [167]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is Telehospital.

Because Telehospital provides services where patients treated online by a physician. It is like providing medicine services remotely to patients.  

A live secure connection is established between patient and physician where physicians diagnose patient disease and recommend transcription.

It is the same as a typical visit to the hospital, except the doctor and patient are not on the same physical location. They are connected with each other remotely.

While other options are not correct because: telenursing is related to providing nursing services online, where telehealth is providing all health care services, it also includes education, training, and administrative services also. While teledoctor and telehospital used interchangeably.

But telehospital is the most and widely used term to diagnose patients remotely by physicians.

7 0
3 years ago
Read 2 more answers
. Alex discovered a bunch of SATA drives in a box at the office and needs to check the contents. What can he do so that Windows
ZanzabumX [31]

You have to make sure the BIOS boot is set to the normal hard drive first, then plug in the SATA cable and power properly

8 0
3 years ago
Targeting encourages drivers to scan far ahead and _____________. A. focus their visual attention on the next point on the road
Colt1911 [192]
<span>A. focus their visual attention on the next point on the road.  A driver must have a target, it can be the car in front, a building pr a structure on the road.  Targeting enables the driver to look further ahead on the road and thus be ready for any obstacle on the road.</span>
3 0
3 years ago
Read 2 more answers
In addition to explaining the paper’s topic, a thesis statement provides instructions on how to read the paper. explains why the
tamaranim1 [39]

Answer: I believe it’s explains why the paper was written!

Explanation:

Took edge 2021

8 0
3 years ago
Read 2 more answers
For the past three years, the interviews conducted at Gavallet, an e-commerce site, have been following the same pattern. Candid
gtnhenbr [62]

Answer:

Structured interviews

Explanation:

An structured interview is an institutionalized method for interviewing work applicants dependent on the particular needs of the activity they are applying for. Up-and-comers are posed similar questions in a similar order, and are altogether looked at on a similar scale

For instance, you can direct them via telephone,  over the Internet, utilizing PC programs, for example, Skype, or utilizing videophone. Organized inquiries questions can be open-finished or shut finished.

3 0
3 years ago
Other questions:
  • What car dealership websites did you use to conduct your research?​
    8·1 answer
  • What are examples of educational obstacles to a career plan?
    13·1 answer
  • When a Firewall is a hardware interface, it is referred as a
    6·1 answer
  • Martha wants to invite her coworkers to her birthday party. She uses the mail merge feature to compose and send the invitations.
    6·1 answer
  • What would happen if a pc that contains a power supply that does not automatically adjust for input voltage is set to 230 volts
    13·1 answer
  • How to see the range of values of vty lines?
    15·1 answer
  • Lisa managed incident response for a bank. The bank has a website that’s been attacked. The attacker utilized the login screen,
    9·1 answer
  • Calcula l'energia (Kwh) consumida per una màquina de 30 CV que funciona durant 2 hores.
    12·1 answer
  • PLEASE ANSWER FAST.one of the barriers for early "talkies" was the need to manually crank the projector and manually synchronize
    13·1 answer
  • _______________________ variables do not need to be declared inside the function definition body, they get declared when the fun
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!