Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5.  
  6. void menu (){
  7. int x, choice;
  8. char key;
  9. string un[10];
  10. string pw[10];
  11.  
  12. do
  13. {
  14. cout<<"MENU"<<endl;
  15. cout<<"\n1. SIGN UP";
  16. cout<<"\n2. OUTPUT";
  17. cout<<"\n3. Exit";
  18.  
  19. cout<<"\n\nChoose one: "<<endl;
  20. cin>>choice;
  21.  
  22. switch(choice)
  23. {
  24. case 1:
  25. system("CLS");
  26. for(x=0; x<10; x++)
  27. {
  28. cout<<"Enter username: ";
  29. cin>>un[x];
  30. cout<<"Enter password: ";
  31. cin>>pw[x];
  32. cout<<endl;
  33. }
  34. break;
  35.  
  36. case 2:
  37. system("CLS");
  38. for(x=0; x<10; x++)
  39. {
  40. cout<<"Username: "<<un[x];
  41. cout<<"\nPassword: "<<pw[x]<<endl;
  42. cout<<endl;
  43. }
  44. break;
  45.  
  46. case 3:
  47. exit(0);
  48. break;
  49.  
  50. default:
  51. cout<<"Invalid choice. Try again.";
  52. }
  53. cout<<"\nPress B to go back to Menu. ";
  54. cin>>key;
  55. system("CLS");
  56.  
  57. }while(key=='b' || key=='B');
  58. }
  59.  
  60.  
  61. int main(int argc, char *argv[]) {
  62.  
  63. menu ();
  64.  
  65. return 0;
  66.  
  67.  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement