Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2011
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include "course.h"
  2. #include <iostream>
  3. #include <fstream>
  4. using namespace std;
  5.  
  6. course::course(int pubAnswers[4]){
  7.     a=0,b=0,c=0,d=0;
  8.     numberRightOverall=0;
  9.     for(int i=0;i<4;i++)
  10.         numberRightVersion[i]=0;
  11.     numberRightOverall=pubAnswers[0]+pubAnswers[1]+pubAnswers[2]+pubAnswers[3];
  12.     a=pubAnswers[0];
  13.     b=pubAnswers[1];
  14.     c=pubAnswers[2];
  15.     d=pubAnswers[3];
  16. }
  17. void course::courseWrite(){
  18.     ofstream output;
  19.     output.open("Course Overview.txt");
  20.     output<<"The number of answers correct for this course is "<<numberRightOverall<<endl;
  21.     output<<"The number of answers correct for this Test A is "<<a<<endl;
  22.     output<<"The number of answers correct for this Test B is "<<b<<endl;
  23.     output<<"The number of answers correct for this Test C is "<<c<<endl;
  24.     output<<"The number of answers correct for this Test D is "<<d<<endl;
  25.     output.close();
  26. }
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement