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]
3 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]3 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
Humans are refers to the use of the computer. True/False?
lisov135 [29]

Answer:

no they aren't so the answer is no

4 0
2 years ago
"Write an SQL query that displays the Ssn and Last name of all employees who is a supervisor of a Department Manager"
Karo-lina-s [1.5K]

Answer:

SELECT Ssn,

             Last_name

 FROM employees

WHERE position = supervisor;

Explanation:

SELECT is an SQL query statement that is used to initiate the display of wanted variables.

The names of the variables often succeed the SELECT statement and they are separated by commas.

FROM is an SQL query statement that indicates the table fro which the selected variables be displayed.

WHERE is used to filter your search and return only rows that meet the criteria.

; signifies the end of a query and calls for an execution.

3 0
3 years ago
Multiple Select
s344n2d4d5 [400]

Since you wrote a program to compare the portion of drivers who were on the phone. The statements are true are option  2, 3, 4 and 5:

2. You could modify the program to allow the user to enter the data.

3. A different set of observations might result in a larger portion of male drivers being on the phone.

4. Even when confident that the mathematical calculations are correct, you still need to be careful about how you interpret the results.

5. It is important to test your program with a small enough set of data that you can know what the result should be.

<h3>What use does a driver program serve?</h3>

A computer software known as a driver, sometimes known as a device driver, that serves as a bridge between the operating system and a device such a disk drive, or keyboard. The device's collection of specific commands must be thoroughly understood by the driver.

In software, a driver offers a programming interface for managing and controlling particular lower-level interfaces that are frequently connected to a particular kind of hardware or other low-level service.

Therefore,  based on the fact that the code you have made is okay, you can make some a notes on what is good and not and then make adjustments.

Learn more about program drivers from

brainly.com/question/28027852

#SPJ1

4 0
2 years ago
According to "When Is a Planet Not a Planet?" scientists determined that Pluto was not a planet. What were the causes that led t
Murrr4er [49]

Answer:

Hi there!

The correct answer will be: C. Pluto’s orbit crossed over the orbit of another planet.

Explanation:

When determining whether a planet is planet the IAU stated the planet must (a) is in orbit around the Sun, (b) has sufficient mass for its self-gravity to overcome rigid body forces so that it assumes a hydro-static equilibrium (nearly round) shape, and (c) has cleared the neighborhood around its orbit. For poor Pluto's case he did not clear part (c).

8 0
3 years ago
1. Your boss wants you to sign your timesheet electronically. Which of the following is not a possible way to represent an elect
photoshop1234 [79]
1b2c3a4d5a6c7d8b9a10a
6 0
4 years ago
Other questions:
  • What are two examples of ways an electronic record may be distributed to others?
    15·1 answer
  • Which type of worker would most likely be able to begin work after receiving a high school degree and completing an
    13·1 answer
  • For each of the descriptions below, perform the following tasks:
    6·1 answer
  • I have a PTCL Router. When I reset it it stops working. So if I backup its settings and use them after reset will my PTCL Work
    13·2 answers
  • Please help hellllllp
    7·1 answer
  • Computer hardware refers to: Group of answer choices the mechanism through which users interact with a computer. handheld comput
    13·1 answer
  • 2. What is the first part of the 3D printing process ?
    11·1 answer
  • If one of the resistors is turned off (I.e. , a light bulb goes out), what happens to the other resistors (light bulbs) in the c
    15·1 answer
  • When you type information into a document property field on the cover page, Word does not automatically add this information to
    11·1 answer
  • find_cow(name, cows) Given a name and a Python list of Cow objects, return the Cow object with the specified name. If no such Co
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!