Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- int main()
- {
- int Age1,ID1,Total1,Input;
- int Age2,ID2,Total2;
- int Age3,ID3,Total3;
- ifstream Read1("R1.txt");
- ifstream Read2("R2.txt");
- ifstream Read3("R3.txt");
- Read1>>ID1>>Age1>>Total1;
- Read2>>ID2>>Age2>>Total2;
- Read3>>ID3>>Age3>>Total3;
- cout<<"Please enter student ID:";
- cin>>Input;//800111
- if(Input==ID1)
- {
- cout<<"THe id is:"<<ID1<<endl;
- cout<<"THe Age is:"<<Age1<<endl;
- cout<<"THe Total percent is:"<<Total1<<endl;
- }
- else if(Input==ID2)
- {
- cout<<"THe id is:"<<ID2<<endl;
- cout<<"THe Age is:"<<Age2<<endl;
- cout<<"THe Total percent is:"<<Total2<<endl;
- }
- else if(Input==ID3)
- {
- cout<<"THe id is:"<<ID3<<endl;
- cout<<"THe Age is:"<<Age3<<endl;
- cout<<"THe Total percent is:"<<Total3<<endl;
- }
- else{
- cout<<"Incorrect ID entered!";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement