Modify the test scores program

Assignment Help Computer Engineering
Reference no: EM13322667

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 <iostream>
#include <iomanip>
#include <fstream> // ( 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
{

 

Reference no: EM13322667

Questions Cloud

Determine the maximum absolute values of the shear : Draw the shear and bending moment diagrams for the beam AB, and determine the maximum absolute values of the shear and bending moment.
Name and briefly describe each of these categories : Streaming video can systems can be classified into three categories. Name and briefly describe each of these categories?
What is the average force on the rope during the tow : The 5.5 Mg humpback whale is stuck on the shore due to changes in the tide. In an effort to rescue the whale, a 12-Mg tugboat is used to pull it free using an inextensible rope tied to its tail.
Explain combustion of the alternative fuel and hydrogen gas : The combustion of the alternative fuel, hydrogen gas, released 286 kj per mole of hydrogen gas combusted. if 10.0 l of hydrogen gas at STP was burned to produce electricity, how long would it power a 100 watt light bulb. assume no energy is lost t..
Modify the test scores program : 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.
What is the head loss due to friction per 1000 m of pipe : Water flows through a 250-mm diameter steel (C=120) pipe at a a velocity, V = 1.5 m/s. Using the Hazen-Williams equation, what is the head loss due to friction per 1000 m of pipe
What is the centerline uniform water depth in the channel : A 2-ft diameter circular pipe has a Manning's n of 0.013 and a bed slope of 2.0 X 10^-3. What is the uniform flow rate in this pipe if it is completely full (Qf) in ft^3/s
State what effect on the value of ca(oh)2''s ksp : What effect on the value of Ca(OH)2's Ksp (6.5x10^-6 ) would sucking up some suspended calcium hydroxide solid have. Would the Ksp value be higher or lower than the normal value. Why
Outline the major influences on business buyers : Outline the major influences on business buyers. Why is it important for the business-to-business buyer to understand these major influences?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Web-based sites offer file sharing equal to napster

Do a Web search for stories about Napster and its legal battles. Why has the Recording Industry Association of America (RIAA) filed its lawsuit? How is this different from making a VHS copy of a movie or TV show with your VCR.

  What advantages exist in having the wireless network

As wireless networks gain popularity there is an increasing number of households using them for their home networking needs. What benefits exist in having a wireless network in your home instead of a wired network.

  What kind of algorithm is required

figuring out how to find the last element of the print statement. For array A(N) and input element ARG, what kind of algorithm is needed to determine which element of A(N) is closest to but not greater than ARG? I've gotten this far but can't find..

  Knowledge of agency level enterprise operating systems

information of advanced Relational Database management Systems (RDMS) operating over a wide-area network. (note: Please explain RDMS operating over a WAN.)

  The header fields in the ipv4 and ipv6 protocols

Compare the header fields in the IPv4 and IPv6 protocols. explain some strategies for converting IPv4 packets to IPv6 packets in a hybrid IP network.

  What are the factors management

Based upon personal experience, describe some of the ways that a technology change has benefited a company that you work or worked for such as United Parcel Service? (List three technology changes).

  Service is used to automatically assign ip addresses

explain an IP address. Describe Class A, B, and C networks. Are a MAC address and an IP address the same thing? What network service is used to automatically assign IP addresses? Describe the four steps of the IP address lease process.

  Why java is currently a popular programming language

Why do you think that Java is currently a famous programming language? Do you think Java will continue to be as widely received as it has been, or do you think it will experience an eventual decline.

  Write down java application to accomplish

Ask users for the past 5 years of federal taxes they have paid, save this data to an array, search for largest and the smallest amount of tax, and display it to screen.

  Give a recursive algorithm for fibonacci numbers

give A Recursive Algorithm for Fibonacci Numbers. utlize a computational program or program.

  Write down three separate simple exception handlers

Write down three separate simple exception handlers, one for dividing by zero, another for attempting to open a nonexistent file, and the last for an array out-of-bounds check.

  Design a "clear" button that clears all of the hours worked

make a "Calculate" button to perform the pay calculations for all of the employees.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd