Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Lab 06
- #include <iostream>
- #include <fstream>
- #include <sstream>
- #include <string>
- #include <iomanip>
- using namespace std;
- void bubblesort();
- void Records(int ID);
- int main()
- {
- //Variables
- string Sub;
- int count = 0;
- int i = 0, h = 0;
- int E1 = 0;
- int E2 = 0;
- const int Size = 30;
- //Arrays of Grades
- int StuIds[Size];
- int Exam1[Size];
- int Exam2[50];
- int Exam3[50];
- int Exam4[50];
- int Final[50];
- int Lab1[50];
- int Lab2[50];
- int Lab3[50];
- int Lab4[50];
- int Lab5[50];
- int Lab6[50];
- int QuizAVG[50];
- //OutputFile.open("report.txt");
- //Open Input File
- ifstream InputFile;
- InputFile.open("data1.txt");
- if (!InputFile)
- {
- cout << "Error opening file.\n";
- return 0;
- }
- //Validate file is open
- cout << "Report file is now reading.\n";
- //Read File line by line
- while (!InputFile.eof())
- {
- getline(InputFile, Sub, ':');
- InputFile >> i;
- InputFile.ignore(numeric_limits<streamsize>::max(), '\n');
- cout << Sub << ":" << i << endl; //Seperate string from interger
- E1 = i;
- Exam1[Size] = E1;
- Exam2[Size] = E2;
- Exam3[Size] = E1;
- cout << "example" << i << "/" << E1 << endl;
- }
- cout << "The numbers are : " << Exam1[Size] << " " << Exam2[Size] << " ";
- //InputFile >> Ids;
- //InputFile >> E1;
- //InputFile >> E2;
- //InputFile >> E3;
- //InputFile >> E4;
- //InputFile >> E;
- //InputFile >> Size;
- //InputFile >> Size;
- //InputFile >> Size;
- //InputFile >> Size;
- //InputFile >> Size;
- //InputFile >> Size;
- //InputFile >> Size;
- //Get scores from file
- //InputFile >> StudentId[50];
- //InputFile >> Exam1[50];
- //InputFile >> Exam2[50];
- //InputFile >> Exam3[50];
- //InputFile >> Exam4[50];
- //InputFile >> Final[50];
- //InputFile >> Lab1[50];
- //InputFile >> Lab2[50];
- //InputFile >> Lab3[50];
- //InputFile >> Lab4[50];
- //InputFile >> Lab5[50];
- //InputFile >> Lab6[50];
- //InputFile >> QuizAVG[50];
- //Grade Report
- //cout << "\nGrade Report";
- //Close file
- //InputFile.close();
- cout << "File is now closed.";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement