(Solved) : Test 3 Part B Consists Three Tasks Debug Modify Program C Due 11 26 19 Please Note Well Te Q42715905 . . .

Test 3 Part B consists of three tasks: Debug and Modifya program. (C++)

DUE 11/26/19

Please note that to do well on Test 3 both Part A and Part Bmust be completed.

  1. Debug, (find the errors and correct them in),the program, T3DebugProg.cpp (worth 20points):

Note:

  1. The file is attached with this part of the test – downloadit.
  2. Note that there are 6 errors.
  3. For debug assignments — Overall Assignment worth 2 points:
    1. DO NOT take out comments
    2. DO NOT rearrange the code!
    3. DO NOT change the code standards!
  4. Each error you find is worth 3 points for 18points total.  
    1. Find the bug
    2. Fix the bug
    3. Document the bug in the code to make it easy to fine
    4. You will lose points for incorrectly fixingthe bug.
  5. The program should run correctly when you have found andcorrected all 6 errors. Some are syntax andsome are logic errors.
  6. Submit both source code (*.cpp file),output files and screen print of runningprogram.

// Test Scores Debug // Debug Program — there are 6 errors in this program// Correct this program#include <iostream>#include <iomanip>using namespace std; void readData(ifstream& inputFile, int list[], int size);void holdscrn( ); // void function to hold screen open before exitint main(){ int scores[8] = {0}; ifstream infile; infile.open(“TestScoresData.txt”); if (infile) { 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; cin >> score; while (inputFile) { index = score / 25; if (index == size) index–; if (index < size) list[index]++; inputFile >> score; } return 0;}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++) { cout << setw(3) << lowRange << ” – ” << upperRange << setw(15) << 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{ char holdscreen; cout << “nntEnter one character and press return to exit program: “; cin >> holdscreen; return;}

Test Scores: Data

76 89 150 135 200 76 12 100 150 28 178 189 167 200 175 150 87 99 129149 176 200 87 35 157 189

Expert Answer


Answer to Test 3 Part B consists of three tasks: Debug and Modify a program. (C++) DUE 11/26/19 Please note that to do well on Tes…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us