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
South Africa is the main supplier of which minerals in the world​
kenny6666 [7]

South Africa has the largest reserves of Platinum-group metals (PGMs; 88%), Manganese (80%), Chromite (72%) and Gold (13%) known reserves in the world. It is ranked second in Titanium minerals (10%), Zirconium (25%), Vanadium (32%), Vermiculite (40%) and Fluorspar (17%).

6 0
3 years ago
Read 2 more answers
Which of the following statements are valid in Java? (Assume that console is Scanner object initialized to the standard input de
san4es73 [151]

Answer:

Both (i) and (ii) are valid in Java

Explanation:

In (i) 'area' is a variable property of the object myCircle. It could be assigned a value. In this case it has been assigned a value equal to the product of 3.14 and the square of the read input of type double from the keyboard.

After assigning a value to area, it could be printed directly to the console using the println method.

In (ii) 'area' is a method property of the object myCircle. It could be called when the value of the radius(r) has been set using a second method 'set' of myCircle. The call to myCircle.area() probably prints the area of the circle, myCircle, to the console.

In summary, though different, both are valid ways of doing the same thing.

Hope this helps!

6 0
3 years ago
Follow me on insta Aaftabkhan_7​
liq [111]

Answer:

stop just stop this app is for studying  not for ur insta

Explanation:

8 0
3 years ago
Read 2 more answers
What expressions will initialize d with a random value such that all possible values for d are given by the inequality 1.5 ≤ d &
Kaylis [27]

Answer:

The solution code is written in Python

d = 1.5 + random.random() * 6

Explanation:

By presuming the Python random module is imported, we can use the <em>random</em> method to generate a random number.  <em>random.random()</em> will give us a value in the range [0, 1). The ensure the lower limit is 1.5 instead of 0, we can add 1.5 to random.random()

  •      1.5 + random.random()

This expression will give any value in range [1.5, 2.5)

To ensure the upper limit is set to 7.5, we tweak the previous expression to

  • 1.5 + random.random() * 6  

This expression will always multiply a random number from [0,1) with 6 and then only added with 1.5. This will always produce a random number that fulfill the inequality 1.5 ≤ d < 7.5

7 0
3 years ago
What is the first step necessary to begin setting up a website once a host has been selected and paid?
NemiM [27]

Answer: Select a domain name

4 0
3 years ago
Other questions:
  • write a pseudo code and flow chart that take a number as input and prints multiplication table up to 10
    9·1 answer
  • write an algorithm that gets the price for item A plus the quantity purchased. The algorithm prints the total cost, including a
    5·1 answer
  • You are writing a report using a template provided by your supervisor. If you increase the margins around your pages by 30 perce
    5·1 answer
  • Suppose you use Batch Gradient Descent to train a neural network and you plot the training error at every epoch. If you notice t
    7·1 answer
  • What do you do to add a line or circle to your presentation?
    7·2 answers
  • What do u mean by software​
    7·1 answer
  • Complete the function to return the factorial of the parameter,
    9·2 answers
  • Data bars are a form of ________.
    8·2 answers
  • If you want the input gear to spin in the same direction as the output gear you must use a _______ gear.
    13·1 answer
  • An engineer is designing an HTML page and wants to specify a title for the browser tab to display, along with some meta data on
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!