Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3. using namespace std;
  4. int main()
  5. {
  6. int Age1,ID1,Total1,Input;
  7. int Age2,ID2,Total2;
  8. int Age3,ID3,Total3;
  9. ifstream Read1("R1.txt");
  10. ifstream Read2("R2.txt");
  11. ifstream Read3("R3.txt");
  12. Read1>>ID1>>Age1>>Total1;
  13. Read2>>ID2>>Age2>>Total2;
  14. Read3>>ID3>>Age3>>Total3;
  15. cout<<"Please enter student ID:";
  16. cin>>Input;//800111
  17. if(Input==ID1)
  18. {
  19. cout<<"THe id is:"<<ID1<<endl;
  20. cout<<"THe Age is:"<<Age1<<endl;
  21. cout<<"THe Total percent is:"<<Total1<<endl;
  22. }
  23. else if(Input==ID2)
  24. {
  25. cout<<"THe id is:"<<ID2<<endl;
  26. cout<<"THe Age is:"<<Age2<<endl;
  27. cout<<"THe Total percent is:"<<Total2<<endl;
  28. }
  29. else if(Input==ID3)
  30. {
  31. cout<<"THe id is:"<<ID3<<endl;
  32. cout<<"THe Age is:"<<Age3<<endl;
  33. cout<<"THe Total percent is:"<<Total3<<endl;
  34. }
  35. else{
  36. cout<<"Incorrect ID entered!";
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement