Advertisement
Guest User

Untitled

a guest
Apr 8th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. //Cesar and Matt
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. void info();
  7. void boot();
  8. void personinfo();
  9. void login();
  10. void options();
  11. void program();
  12. void finish();
  13.  
  14.  
  15. void login()
  16. {
  17. string username = "Cesarmatt";
  18. string password = "Prep";
  19.  
  20. cout << "Welcome to the login screen. " << endl;
  21. cout << "Your username is Cesarmatt. Enter your username:";
  22. cin >> username;
  23. cout << "Your password is: Prep. Enter your password now:";
  24. cin >> password;
  25. if(username == "Cesarmatt" && password == "Prep")
  26. cout << "Welcome to the C++ simulator. Have fun!" << endl;
  27. cout << "Now that you have loged in you can choose what you would like to do."<< endl;
  28. options();
  29.  
  30. cout<< "Before starting the program, please let us know who you are." << endl;
  31.  
  32. }
  33. void personinfo()
  34. {
  35. struct info
  36. {
  37. char lname[20];
  38. char fname[20];
  39. int id_number;
  40. };
  41. {
  42. info info1;
  43. cout << "Enter information (In order as followed)" << endl;
  44. cout << "1.First Name:" << endl;
  45. cin >> info1.fname;
  46. cout << "2.Last Name:" << endl;
  47. cin >> info1.lname;
  48. cout << "3. ID (NUMBERS): " << endl;
  49. cin >> info1.id_number;
  50. cout << "The students information is as followed: " << endl;
  51. cout << "First name: " << info1.fname << endl;
  52. cout << "Last name: " << info1.lname << endl;
  53. cout << "ID: " << info1.id_number << endl;
  54.  
  55. }
  56. void program ();
  57.  
  58. {
  59. int main ();
  60. {
  61. // an array with 3 rows and 2 columns.
  62. int a[3][3] = { {10000,1}, {20000,2}, {30000,3}};
  63.  
  64. // output each array element's value
  65. for ( int i = 0; i < 3; i++ )
  66. for ( int j = 0; j < 3; j++ )
  67. {
  68. cout << "a[" << i << "][" << j << "]: ";
  69. cout <<"Price:"<< a[i][j]<< endl;
  70. }
  71.  
  72. exit (0);
  73. }
  74. }void finish();
  75. {
  76. int choice;
  77. cout << "Enter 1 if you would like to run a C++ program." << endl;
  78. cout << "Enter 2 if you would like to log of this computer and come back to the login screen." << endl;
  79. cout << "Enter 3 if you would like to shutdown your computer." << endl;
  80. cin >> choice;
  81. switch (choice)
  82. {
  83. case 1: program();
  84. case 2: cout << "You have chosen to log out of the computer please re-enter all the needed information." << endl;
  85. login();
  86. case 3: cout << "You have chosen to end the program. Thank you for using the C++ program." << endl;
  87. exit(0);
  88. }
  89. {
  90. }
  91.  
  92. void boot();
  93. {
  94. boot(); { // the booting from drives and system check for moniter, keyboard, and mouse
  95. int choice;
  96.  
  97. cout << "welcome to the os. this is a computer and operating system designed to help you track prices of cars.";
  98. cout << endl << "Checking to see if your mouse and keyboard are connected..."<< endl;
  99. cout << endl << "Now both your mouse and keyboard are connected. You can now access the system ";
  100. cout << endl << "Would you like to boot from your hard drive or ssd? type 1 for hdd or 2 for ssd";
  101. cin >> choice;
  102. if ( choice == 1 )
  103. {
  104. cout << "you will now boot from the hdd";
  105. login();
  106. }
  107. else if ( choice == 2) {
  108. cout << " you will now boot the sdd";
  109. login();
  110. }
  111. else {
  112. cout << "not a valid option try again";
  113. }
  114. }
  115. int main();
  116. {
  117. void info();
  118. boot();
  119. login();
  120. personinfo();
  121. program();
  122. options();
  123. finish();
  124. }
  125. }
  126. }
  127. exit (0);
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement