Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. //Lab 06
  2. #include <iostream>
  3. #include <fstream>
  4. #include <sstream>
  5. #include <string>
  6. #include <iomanip>
  7. using namespace std;
  8.  
  9. void bubblesort();
  10. void Records(int ID);
  11.  
  12.  
  13. int main()
  14. {
  15. //Variables
  16. string Sub;
  17. int count = 0;
  18. int i = 0, h = 0;
  19. int E1 = 0;
  20. int E2 = 0;
  21. const int Size = 30;
  22.  
  23. //Arrays of Grades
  24. int StuIds[Size];
  25. int Exam1[Size];
  26. int Exam2[50];
  27. int Exam3[50];
  28. int Exam4[50];
  29. int Final[50];
  30. int Lab1[50];
  31. int Lab2[50];
  32. int Lab3[50];
  33. int Lab4[50];
  34. int Lab5[50];
  35. int Lab6[50];
  36. int QuizAVG[50];
  37.  
  38. //OutputFile.open("report.txt");
  39. //Open Input File
  40. ifstream InputFile;
  41. InputFile.open("data1.txt");
  42. if (!InputFile)
  43. {
  44. cout << "Error opening file.\n";
  45. return 0;
  46. }
  47.  
  48. //Validate file is open
  49. cout << "Report file is now reading.\n";
  50.  
  51. //Read File line by line
  52. while (!InputFile.eof())
  53. {
  54. getline(InputFile, Sub, ':');
  55. InputFile >> i;
  56. InputFile.ignore(numeric_limits<streamsize>::max(), '\n');
  57. cout << Sub << ":" << i << endl; //Seperate string from interger
  58.  
  59. E1 = i;
  60. Exam1[Size] = E1;
  61. Exam2[Size] = E2;
  62. Exam3[Size] = E1;
  63.  
  64.  
  65. cout << "example" << i << "/" << E1 << endl;
  66. }
  67.  
  68. cout << "The numbers are : " << Exam1[Size] << " " << Exam2[Size] << " ";
  69.  
  70.  
  71. //InputFile >> Ids;
  72. //InputFile >> E1;
  73. //InputFile >> E2;
  74. //InputFile >> E3;
  75. //InputFile >> E4;
  76. //InputFile >> E;
  77. //InputFile >> Size;
  78. //InputFile >> Size;
  79. //InputFile >> Size;
  80. //InputFile >> Size;
  81. //InputFile >> Size;
  82. //InputFile >> Size;
  83. //InputFile >> Size;
  84.  
  85.  
  86. //Get scores from file
  87. //InputFile >> StudentId[50];
  88. //InputFile >> Exam1[50];
  89. //InputFile >> Exam2[50];
  90. //InputFile >> Exam3[50];
  91. //InputFile >> Exam4[50];
  92. //InputFile >> Final[50];
  93. //InputFile >> Lab1[50];
  94. //InputFile >> Lab2[50];
  95. //InputFile >> Lab3[50];
  96. //InputFile >> Lab4[50];
  97. //InputFile >> Lab5[50];
  98. //InputFile >> Lab6[50];
  99. //InputFile >> QuizAVG[50];
  100.  
  101. //Grade Report
  102. //cout << "\nGrade Report";
  103.  
  104. //Close file
  105. //InputFile.close();
  106. cout << "File is now closed.";
  107.  
  108. return 0;
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement