Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Modify the program

Modify the Test Scores program from the above Debug Section into a class grade book that includes a class of up to 20 students and 3 test grades. Each test is read in as a separate file, so 3 Test files are required. The students' grades should be kept in an array. Once all three test scores are read in, calculate each student's average and grade for the class. Also print a report of the each student's test grades, average and final grade as a table, and then print the averages of each Test and overall Test Average, as well as highest Test Grade of all Tests and the student with thehighest class grade.

Required for program grade:

1. Source Code (complete)
2. Sample Input files
3. Screenshot of running program.
// Test scores Program which needs to modify according above requirments
// Test Scores Debug
// Debug Program -- there are 6 errors in this program
// Correct this program
// worked with Omar and Sunita
#include
#include
#include // ( fstream missing debug 1)

int main()
{
int scores[8] = {0};

ifstream infile;

infile.open("TestScoresData.txt");

if (!infile) // ( ! missing debug 3)
{
cout << "Cannot open the input file. Program terminates!"
<< endl;
holdscrn( ); // Hold screen before exit
return 1;
}

readData(infile, scores, 8);
print(scores, 8);
cout << endl;

infile.close();
holdscrn( ); // Hold screen before exit
return 0;
}

void readData(ifstream& inputFile, int list[], int size)
{
int score;
int index;

inputFile >> score; // (missing input file debug 4)

while (inputFile)
{
index = score / 25;

if (index == size)
index--;
if (index < size)
list[index]++;

inputFile >> score;
}
return;// ( return value not required debug 5)
}

void print(int list[], int size)
{
int range;
int lowRange = 0;
int upperRange = 24;

cout << " Range # of Students" << endl;

for (range = 0; range < size; range++)

{
if (lowRange < 100) // ( if else statement missing debug 6)
{
cout << setw(3) << lowRange << " - "
<< upperRange << setw(15)
<< list[range] << endl;
}
else
{
cout << setw(3) << lowRange << " - "
<< upperRange << setw(14)
<< list[range] << endl;
}
lowRange = upperRange + 1;
upperRange = upperRange + 25;
if (range == size - 2)
upperRange++;
}
cout << endl;
return;
}

void holdscrn( ) // void function to hold screen open before exit
{

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9901969

Have any Question?


Related Questions in Computer Engineering

Subject computer algorithmsbook introduction to algorithms

Subject : Computer Algorithms Book: Introduction to Algorithms 3rd edition 1) a) Using Figure 10.1 as a model, illustrate the result of each operation in the sequence PUSH(S,6), PUSH(S,2), PUSH(S,8), POP(S), PUSH(S,5), P ...

Question when we studied clusters we discovered that

Question : When we studied clusters we discovered that semaphores, the mechanism we rely on for mutual exclusion, don't work, and so we studied message-passing as an alternative that does work on clusters. Why do semapho ...

You often read in the newspapers that the fed has just

You often read in the newspapers that the Fed has just lowered the discount rate. Does this signal that the Fed is moving toward a more expansionary monetary policy? Why or why not?

These sctp data chunks have arrived carrying the following

These SCTP DATA chunks have arrived carrying the following information: TSN:20 SI:2 SSN:8 BE:11 TSN:21 SI:2 SSN:9 BE:10 TSN:12 SI:2 SSN:7 BE:11 TSN:18 SI:3 SSN:15 BE:01 TSN:15 SI:3 SSN:15 BE:00 TSN:24 SI:1 SSN:23 BE:10 I ...

A series of information frames with a mean length of 100

A series of information frames with a mean length of 100 bits is to be transmitted across the following data links using an idle RQ protocol. If the velocity of propagation of the links is 2 * 10 8 ms -1 , determine the ...

Argue why wireshark should be outlawed and it is a clear

Argue why Wireshark should be outlawed and it is a clear violation of privacy act and then argue why it should not be out outlawed and that it is a vital resource to be freely used and does not violate the privacy act

Not all context free grammars define regular languages

Not all context free grammars define regular languages. However, the following two DO define regular languages. For each grammar below, (a) describe the corresponding language and (b) draw the corresponding finite state ...

With regards to data mining business analytics why is it

With regards to data mining/ business analytics, Why is it not ideal to evaluate a classifier's performance on the training data set?

Discussion question a sketch the storyboard for the simple

Discussion Question : a) Sketch the storyboard for the simple student information application. Recall that there are 6 files (scripts): connectcode.php, createtables.php, enterstudent.html, enterstudent.php, showstudents ...

Explain the risk of having hacking tools installed on your

Explain the risk of having hacking tools installed on your computer and why you should contact local law enforcement agencies before installing those tools.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As