Advertisement
Guest User

Main Function

a guest
Nov 2nd, 2011
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.72 KB | None | 0 0
  1. #include "Student.h"
  2. #include "Instructor.h"
  3. #include "Exam.h"
  4. #include "course.h"
  5. #include <iostream>
  6. #include <Windows.h>
  7. #include <ctime>
  8. using namespace std;
  9.  
  10. void main(){
  11.         //Variables Used
  12.         srand(time(0));
  13.         int tempKids[2][4][16][100];
  14.         int tempE[100];
  15.         int temp;
  16.         int tempA[100][2];
  17.         int tempB[100][2];
  18.         int tempC[100][2];
  19.         int tempD[100][2];
  20.         int tests[4]={0,0,0,0};
  21.        
  22.         //Creates Classes
  23.         Students kids[2][4][16];
  24.         Exam A[4];
  25.        
  26.         //Gets key for each test
  27.         A[0].getKey(tempA);
  28.         A[1].getKey(tempB);
  29.         A[2].getKey(tempC);
  30.         A[3].getKey(tempD);
  31.  
  32.         //writes Exams to txt
  33.         for(int i=0;i<4;i++)
  34.             A[i].writeExam(i);
  35.        
  36.         //gets Versions of the test and sets the Key for each student
  37.         for(int x=0; x<2; x++)
  38.             for(int y=0;y<4;y++)
  39.                 for(int z=0;z<16;z++)
  40.                 {
  41.                     temp = x+(16*y)+(64*z);
  42.                     kids[x][y][z].getVersion(temp);
  43.                 }
  44.  
  45.         //Checks the answers for all the kids
  46.         for(int x=0; x<2; x++)
  47.             for(int y=0;y<4;y++)
  48.                 for(int z=0;z<16;z++)
  49.                 {
  50.                     switch(kids[x][y][z].getSN()){
  51.                     case 0:
  52.                         kids[x][y][z].checkAnswers(tempA);
  53.                         kids[x][y][z].getCorrect(tempE);
  54.                         A[0].findCorrect(tempE);
  55.                         kids[x][y][z].checkGrade();
  56.                         break;
  57.                     case 1:
  58.                         kids[x][y][z].checkAnswers(tempB);
  59.                         kids[x][y][z].getCorrect(tempE);
  60.                         A[1].findCorrect(tempE);
  61.                         kids[x][y][z].checkGrade();
  62.                         break;
  63.                     case 2:
  64.                         kids[x][y][z].checkAnswers(tempC);
  65.                         kids[x][y][z].getCorrect(tempE);
  66.                         A[2].findCorrect(tempE);
  67.                         kids[x][y][z].checkGrade();
  68.                         break;
  69.                     case 3:
  70.                         kids[x][y][z].checkAnswers(tempD);
  71.                         kids[x][y][z].getCorrect(tempE);
  72.                         A[3].findCorrect(tempE);
  73.                         kids[x][y][z].checkGrade();
  74.                         break;
  75.                     }
  76.                 }
  77.  
  78.         //finds the statistics of answers for all and per section for exam class
  79.         /*for(int x=0;x<2; x++)
  80.             for(int y=0;y<4;y++)
  81.                 for(int z=0;z<16;z++)
  82.                     for(int i=0; i<4; i++)
  83.                     {
  84.  
  85.                         kids[x][y][z].getCorrect(tempE);
  86.                         A[i].findCorrect(tempE);
  87.                         A[i].correctSec(tempE);
  88.                         kids[x][y][z].checkGrade();
  89.                         //gets all the correct and incorrects
  90.                         for(int i=0;i<100;i++)
  91.                             tempKids[x][y][z][i]=tempE[i];
  92.                         //kids[x][y][z].getCorrect(tempE);
  93.                         kids[x][y][z].StudentWrite(i);
  94.                     }*/
  95.         //Checks grades for students
  96.         kids[1][0][3].StudentWrite(0);
  97.         kids[0][2][13].StudentWrite(1);
  98.         kids[1][1][15].StudentWrite(2);
  99.         kids[0][3][2].StudentWrite(3);
  100.        
  101.                    
  102.         Instructor Kim;
  103.         Kim.LoadData(tempKids);
  104.         for(int i=0; i<4; i++)
  105.             A[i].WriteResults(i);      
  106.         //Write Reports
  107.         //for(int i=0;i<4;i++)
  108.             //kids[2][4][i].StudentWrite(i);
  109.         course Kiwi(tests);
  110.         Kiwi.courseWrite();
  111.         Kim.writeReportIn();
  112.  
  113.        
  114.  
  115. }
  116.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement