Using c This assignment is to practice arrays therefore you

Using c++

This assignment is to practice arrays, therefore you should use arrays to read in all data. Create a program to compute final grades for a class. Professor assigns 10 homework assignment, 2 projects and a final exam. He computes an average for the 10 homework assignments, and an average for the two projects. He then averages those two grades together with the final exam grade to get a final grade for the course. Once again this assignment is to practice arrays, therefore you should use arrays to not only to store the output, but also to read in the project and homework grades. Print out in a neat chart each student’s id number, homework average, project average, final exam grade and final average. There are 10 students in the class.

Solution

#include <iostream>
using namespace std;
int main() {
   int scount = 1,scores=17,i,j;
   double students[scount][scores];
   for(i=0;i<scount;i++){
       cout << \"Enter student \" << (i+1) << \" ID:\";
       cin >> students[i][0];
       int hsum = 0;
       for(j=1;j<11;j++){
           cout << \"Enter Assignment \" << j << \" Score:\";
           cin >> students[i][j];
           hsum = hsum+students[i][j];
       }
       cout << \"Enter Project 1 Grade:\";
       cin >> students[i][11];
       cout << \"Enter Project 2 Grade:\";
       cin >> students[i][12];
       cout << \"Enter Final Grade:\";
       cin >> students[i][13];
       // homework average
       students[i][14] = hsum/10.0;
       // project average
       students[i][15] = (students[i][11] + students[i][12])/2.0;
       // final average
       students[i][16] = (students[i][13] + students[i][14]+students[i][15])/3.0;
   }
   cout<<endl;
   cout << \"ID Number,Homework Average,Project Average,Final Grade,Final Average\"<<endl;
   for(i=0;i<scount;i++){
       cout<<\"\\t\";
       cout<<students[i][0];
       cout<<\",\\t\";
       cout<<students[i][14];
       cout<<\",\\t\";
       cout<<students[i][15];
       cout<<\",\\t\";
       cout<<students[i][13];
       cout<<\",\\t\";
       cout<<students[i][16];
       cout<<endl;
   }
}

Using c++ This assignment is to practice arrays, therefore you should use arrays to read in all data. Create a program to compute final grades for a class. Prof

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site