Advertisement
Guest User

MP3 quarterly

a guest
Apr 7th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 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. personinfo 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 cars [3] [3]=
  60. {10000, 20000, 30000} ,
  61. {1,2,3};// multidimensional array
  62. int *ptr; // tells us that we will be pointing to int cars
  63. ptr= cars;// Ptr is going to be the value of the car
  64.  
  65. cout << "Car prices " << endl; // displays values for the cars
  66. for ( int i = 0; i < 3; i++ ) // i would be used to determine what the value of the first car is. After that, i++ would be used to display the rest of the values until it reaches the third car value.
  67. {
  68. cout << "*(ptr + " << i << ") : "; // displays what the cell it is going to point to. i+0 would be pointing to the first cell and i+1 being the second.
  69. cout << *(ptr + i) << endl;//reads "pointer + (cell number) = value in the cell"
  70. }
  71. }void finish();
  72. {
  73. int choice;
  74. cout << "Enter 1 if you would like to run a C++ program." << endl;
  75. cout << "Enter 2 if you would like to log of this computer and come back to the login screen." << endl;
  76. cout << "Enter 3 if you would like to shutdown your computer." << endl;
  77. cin >> choice;
  78. switch (choice)
  79. {
  80. case 1: program();
  81. case 2: cout << "You have chosen to log out of the computer please re-enter all the needed information." << endl;
  82. login();
  83. case 3: cout << "You have chosen to end the program. Thank you for using the C++ program." << endl;
  84. exit(0);
  85. }
  86. {
  87. }
  88.  
  89. void boot();
  90. {
  91. boot(); { // the booting from drives and system check for moniter, keyboard, and mouse
  92. int choice;
  93.  
  94. cout << "welcome to the os. this is a computer and operating system designed to help you track prices of cars.";
  95. cout << endl << "Checking to see if your mouse and keyboard are connected..."<< endl;
  96. cout << endl << "Now both your mouse and keyboard are connected. You can now access the system ";
  97. cout << endl << "Would you like to boot from your hard drive or ssd? type 1 for hdd or 2 for ssd";
  98. cin >> choice;
  99. if ( choice == 1 )
  100. {
  101. cout << "you will now boot from the hdd";
  102. login();
  103. }
  104. else if ( choice == 2) {
  105. cout << " you will now boot the sdd";
  106. login();
  107. }
  108. else {
  109. cout << "not a valid option try again";
  110. }
  111. }
  112. int main();
  113. {
  114. void info();
  115. boot();
  116. login();
  117. personinfo();
  118. program();
  119. options();
  120. finish();
  121. }
  122. }
  123. }
  124. exit (0);
  125. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement