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
vampirchik [111]
3 years ago
12

Write a program that a C++ program that can be used to determine grades at the end of the semester. For each student, who is ide

ntified by an integer number between 1 and 60, four examination grades must be kept. Additionally, two final grade averages must be computed. The first grade average is simply the average of all four grades. The second grade average is computed by weighting the four grades as follows: the first grade gets a weight of 0.2, the second grade gets a weight of 0.3, the third grade a weight of 0.3, and the fourth grade a weight of 0.2; that is computed as:
0.3*grade1 + 0.2 *grade2 + 0.2 * grade3 + 0.3 * grade4
Computers and Technology
2 answers:
horrorfan [7]3 years ago
4 0

<u>C++ program that can be used to determine grades at the end of the semester</u>

#include <bits/stdc++.h>

using namespace std;

void func() //Defining function

{

   int m;

  double stu[60][10];

  cout<<"Enter number of students\n"; //taking input

  cin>>m;

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

  {

      cout<<"Enter Student Number: ";

      cin>>stu[i][0];

      cout<<"Enter the four grades of student "<<stu[i][0]<<endl;

      cin>>stu[i][1];

      cin>>stu[i][2];

      cin>>stu[i][3];

      cin>>stu[i][4];

  }

 

  //Calculating first grade average and second grade average

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

  {

      stu[i][5] = (stu[i][1] + stu[i][2] + stu[i][3] + stu[i][4])/4;

      stu[i][6] = (0.3*stu[i][1] + 0.2*stu[i][2] + 0.2*stu[i][3] + 0.3*stu[i][4]);

  }

  double sumFAvg=0,sumSAvg=0;

  double classFAvg,classSAvg;

  //Calculating average of first and second grades

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

  {

      sumFAvg = sumFAvg + stu[i][5];

      sumSAvg = sumSAvg + stu[i][6];          

  }

  classFAvg = sumFAvg/m;

  classSAvg = sumSAvg/m;

   cout<<"-----------Class Info ------------------\n";

  cout<<"StudentID   Grade1 Grade2 Grad3 Grad4 FirstGrade SecondGrade\n";

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

  {

      cout<<stu[i][0]<<"\t\t"<<stu[i][1]<<"\t"<<stu[i][2]<<"\t"<<stu[i][3]<<"\t"<<stu[i][4]

      <<"\t"<<stu[i][5]<<"\t"<<stu[i][6]<<endl;

  }

   cout<<"Class First Grade Average: "<<classFAvg<<endl;   //printing output

  cout<<"Class Second Grade Average: "<<classSAvg<<endl;  

 

}

int main() //driver function

{  double sumFAvg=0,sumSAvg=0;

  double classFAvg,classSAvg;

   int m;

  double stu[60][10];

   func(); //calling function

  return 0;

}

<u>Output</u>

Enter number of students 3

Enter Student Number:1 Enter the four grades of student 1-  50 60 70 80

Enter Student Number:2 Enter the four grades of student 2 -30 4 50 6

Enter Student Number:3 Enter the four grades of student 3 - 10 2 30 40

-----------Class Info ------------------

StudentID   Grade1 Grade2 Grad3 Grad4 FirstGrade SecondGrade

1  50 60 70 80 65 65

2  30 4 50 6 22.5 21.6

3  10 2 30 40 20.5 21.4

Class First Grade Average: 36

Class Second Grade Average: 36

OleMash [197]3 years ago
4 0

Answer:

First grade average: 36

Second grade average: 36

Explanation:

You might be interested in
PLEASE HELP!! Kou converged his Word document to a PowerPoint document. When he received the PowerPoint, he was missing material
uranmaximum [27]
C: He forgot to save some certain materials in the PowerPoint.
7 0
3 years ago
Name various input and output devices used with computers.
astra-53 [7]

Answer:

Input: Keyboard, Mouse, Microphone, Gaming Controller

Output: Monitor, TV, Headphones, Speakers

Explanation:

Input Devices are used to send signals to the computer.

Output Devices use signals from the computer to give you information

6 0
2 years ago
Carlos works with a tutor all school year to maintain good grades in his language arts class. However, his tutoring sessions are
Ksivusya [100]

Answer:

I would pick A.

Explanation:

Letting yourself know that making mistakes is a good way to let yourself know you won't completely fail.

8 0
3 years ago
Read 2 more answers
Which file extension indicates a Microsoft Excel document? .txt .ppt .xls .pdf
Alenkinab [10]
Xlsx is the file extension that indicates a microsoft excel document
7 0
4 years ago
Read 2 more answers
Which type of device would you most likely consider installing an SCSI disk in?
eimsori [14]

Answer:

You would install an SCSI disk in a server.

4 0
3 years ago
Other questions:
  • You are designing a wireless network for a client. your client needs the network to support a data rate of at least 54 mbps. in
    10·1 answer
  • Karlie wants to eat a good breakfast before taking a test
    6·2 answers
  • Green screen is best suited for _____.
    13·2 answers
  • Juan copied and pasted information from a Word document
    8·1 answer
  • Who are the people responsible for maintaining and controlling computer networks within an organization?
    10·1 answer
  • You are the head of the corporate security department, and the Microsoft teamhas asked you for some assistance in setting the pa
    11·1 answer
  • Complete the program below named CountVowels so that it reads in a string, counts all the vowels in that string, and prints out
    13·1 answer
  • Input header here<br>input paragraph 1 here
    11·1 answer
  • what is the term used when a virus takes control of features on your computer and transports files or information automatically?
    10·1 answer
  • Jorge, a sports statistician for soccer, has kept track of how many shots-on-goal each player on a team made in each game. This
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!