SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 305 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 24 Dec 2017 My Price 10.00

strings and arrays are involved in this code

I need help with the rest of this code. I know strings and arrays are involved in this code. The HW6 attached explains what needs to be done. The output needs to look like the second page of the HW6. The answers and tests documents attached are used toward the output. It would be much appreciated. Thank you. Using Visual Studio 2017 or 2015. C++.

 

 

#include <fstream>

#include <iostream>

#include <iomanip>

#include <string>

using namespace std;

 

void main()

{

int numstudents = 0, numcorrect, i, chart[20][5] = { 0 };

 

ifstream finkey, finstud;

finkey.open("Answers.dat");

finstud.open("Tests.dat");

ofstream fout;

fout.open("Output.dat");

string key, id, responses;

finkey >> key;

finstud >> id >> responses;

fout << "Student-ID" << setw(50) << "Number Correct" << endl;

while (!finstud.eof())

{

numstudents++;

numcorrect = 0;

for (i = 0; i < 20; i++)

if (key[i] == responses[i])

numcorrect++;

fout << id << numcorrect << endl;

finstud >> id >> responses;

}  

fout << endl;

fout << "Number of students taking exam = " << numstudents << endl;

 

/*we have done the first 2 things asked. Next is the distribution chart

 

/*The new thing is 2D arrays. Declare an array. to call a 2D array element, use the same notation - chart[0][0] is the first element. 

If we didn't want to zero out the chart on the declaration statement, could we do this elsewhere in our code? How? 

  YES!! A nested loop!! We will need the nested loops for HW6, and not just to zero out*/

 

/*You need to tally eveything before outputting it. You can build the chart as you read it. 

Rows= the number of the question shifted by one and Columns= the letter's place in the alphabet. 

Somewhere in the while loop, bump the appropriate chart box. When you print out the actual chart, you can use a nested loop*/

 

system("pause");

}

Attachments:

Answers

(5)
Status NEW Posted 24 Dec 2017 01:12 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)