Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.23 KB | None | 0 0
  1. #include "Instructor.h"
  2. #include <iostream>
  3. #include <fstream>
  4. using namespace std;
  5.  
  6. Instructor::Instructor(){
  7.     instructorOneCorrect=0;
  8.     instructorTwoCorrect=0;
  9.     overallCorrect=0;
  10.  
  11.  
  12. }
  13. void Instructor::LoadData(int pubAnswers[2][4][16][100])
  14. {
  15.     for(int x=0;x<2;x++)
  16.         for(int y=0;y<4;y++)
  17.             for(int z=0;z<16;z++)
  18.                 for(int i=0;i<100;i++)
  19.                 {
  20.                     RawData[x][y][z][i]=pubAnswers[x][y][z][i];
  21.                 }
  22. }
  23. ///////////////////////////////////////////////////////////////////////
  24. void Instructor::findAllCorrect(){
  25.     for(int x=0;x<2;x++)
  26.         for(int y=0;y<4;y++)
  27.             for(int z=0;z<16;z++)
  28.                 for(int i=0;i<100;i++)
  29.                 {
  30.                     overallCorrect =+ RawData[z][y][z][i];
  31.                     instructorOneCorrect =+ RawData[0][y][z][i];
  32.                     instructorTwoCorrect =+ RawData[1][y][z][i];
  33.                 }
  34. }
  35. ///////////////////////////////////////////////////////////////////////
  36. void Instructor::writeReportIn(){
  37.     ofstream output;
  38.     output.open("Instructor Reports.txt");
  39.     output<<"The total answers correct is "<<overallCorrect<<" out of 12800"<<endl;
  40.     output<<"The first instuctor's students got "<<instructorOneCorrect<<" out of 6400"<<endl;
  41.     output<<"The second instuctor's students got "<<instructorTwoCorrect<<" out of 6400"<<endl;
  42.     output.close();
  43. }
  44.  
  45.  
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement