Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2011
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.43 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. #include<fstream>
  9. using namespace std;
  10.  
  11. void main(){
  12.         //Variables Used
  13.         srand(time(0));
  14.         int tempKids[2][4][16][100];
  15.         int tempE[100];
  16.         int temp;
  17.         int tempA[100][2];
  18.         int tempB[100][2];
  19.         int tempC[100][2];
  20.         int tempD[100][2];
  21.         int tests[4]={0,0,0,0};
  22.        
  23.         //Creates Classes
  24.         Students kids[2][4][16];
  25.         Exam A[4];
  26.        
  27.         //Gets key for each test
  28.         A[0].getKey(tempA);
  29.         A[1].getKey(tempB);
  30.         A[2].getKey(tempC);
  31.         A[3].getKey(tempD);
  32.  
  33.         //writes Exams to txt
  34.         for(int i=0;i<4;i++)
  35.             A[i].writeExam(i);
  36.        
  37.         //gets Versions of the test and sets the Key for each student
  38.         for(int x=0; x<2; x++)
  39.             for(int y=0;y<4;y++)
  40.                 for(int z=0;z<16;z++)
  41.                 {
  42.                     temp = x+y+z;
  43.                     kids[x][y][z].getVersion(temp);
  44.                 }
  45.                        
  46.  
  47.         //Checks the answers for all the kids
  48.         for(int x=0;x<2;x++){
  49.             for(int y=0;y<4;y++){
  50.                 for(int z=0;z<16;z++)
  51.                 {
  52.                     if(kids[x][y][z].getSN()==0){
  53.                         kids[x][y][z].checkAnswers(tempA);                     
  54.                         kids[x][y][z].getCorrect(tempE);
  55.                         A[0].findCorrect(tempE);
  56.                         kids[x][y][z].checkGrade();
  57.                         if(x=0)
  58.                             A[0].correctSecOne(tempE);
  59.                         if(x=1)
  60.                             A[0].correctSecTwo(tempE);
  61.                         for(int g=0;g<100;g++)
  62.                             tempKids[x][y][z][g]=tempE[g];
  63.                     }
  64.                     if(kids[x][y][z].getSN()==1){
  65.                         kids[x][y][z].checkAnswers(tempB);
  66.                         kids[x][y][z].getCorrect(tempE);
  67.                         A[1].findCorrect(tempE);
  68.                         kids[x][y][z].checkGrade();
  69.                         if(x=0)
  70.                             A[1].correctSecOne(tempE);
  71.                         if(x=1)
  72.                             A[1].correctSecTwo(tempE);
  73.                         for(int g=0;g<100;g++)
  74.                             tempKids[x][y][z][g]=tempE[g];
  75.                     }
  76.                     if(kids[x][y][z].getSN()==2){
  77.                         kids[x][y][z].checkAnswers(tempC);
  78.                         kids[x][y][z].getCorrect(tempE);
  79.                         A[2].findCorrect(tempE);
  80.                         kids[x][y][z].checkGrade();
  81.                         if(x=0)
  82.                             A[2].correctSecOne(tempE);
  83.                         if(x=1)
  84.                             A[2].correctSecTwo(tempE);
  85.                         for(int g=0;g<100;g++)
  86.                             tempKids[x][y][z][g]=tempE[g];
  87.                     }
  88.                     if(kids[x][y][z].getSN()==3){
  89.                         kids[x][y][z].checkAnswers(tempD);
  90.                         kids[x][y][z].getCorrect(tempE);
  91.                         A[3].findCorrect(tempE);
  92.                         kids[x][y][z].checkGrade();
  93.                         if(x=0)
  94.                             A[3].correctSecOne(tempE);
  95.                         if(x=1)
  96.                             A[3].correctSecTwo(tempE);
  97.                         for(int g=0;g<100;g++)
  98.                             tempKids[x][y][z][g]=tempE[g];
  99.                     }
  100.                     }
  101.                 }
  102.                 }
  103.                
  104.                
  105.  
  106.         //finds the statistics of answers for all and per section for exam class
  107.         /*for(int x=0;x<2; x++)
  108.             for(int y=0;y<4;y++)
  109.                 for(int z=0;z<16;z++)
  110.                     for(int i=0; i<4; i++)
  111.                     {
  112.  
  113.                         kids[x][y][z].getCorrect(tempE);
  114.                         A[i].findCorrect(tempE);
  115.                         A[i].correctSec(tempE);
  116.                         kids[x][y][z].checkGrade();
  117.                         //gets all the correct and incorrects
  118.                         for(int i=0;i<100;i++)
  119.                             tempKids[x][y][z][i]=tempE[i];
  120.                         //kids[x][y][z].getCorrect(tempE);
  121.                         kids[x][y][z].StudentWrite(i);
  122.                     }*/
  123.         //Checks grades for students
  124.        
  125.        
  126.                    
  127.         Instructor Kim;
  128.         Kim.LoadData(tempKids);
  129.         for(int i=0; i<4; i++)
  130.             A[i].WriteResults(i);      
  131.         //Write Reports
  132.         //for(int i=0;i<4;i++)
  133.             //kids[2][4][i].StudentWrite(i);
  134.         course Kiwi(tests);
  135.         Kiwi.courseWrite();
  136.         Kim.writeReportIn();
  137.         for(int x=0;x<2;x++)
  138.             for(int y=0;y<4;y++)
  139.                 for(int z=0;z<16;z++)
  140.                     kids[x][y][z].StudentWrite();
  141.  
  142.        
  143.  
  144. }
  145.  
  146.  
  147.  
  148.  
  149.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement