Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.11 KB | None | 0 0
  1. # include <iostream>
  2. using namespace std;
  3.  
  4. void start(); //declairing the START function
  5. void menu(); //declairing the MENU function
  6. void note(); //declairing the NOTE function
  7. void input(); //declairing the INPUT function
  8. void mainfunc(); //declairing the MAINFUNCTION function
  9. int main()
  10. {
  11. system ("color 7");
  12. system ("color 2F");
  13.  
  14. string username = "";
  15. string pass = "";
  16. bool loginSuccess = false;
  17.  
  18. cout<<"\n";
  19. cout<<"\t\t=====WELCOME TO THE GARAGE MANAGEMENT APP=====\n";
  20.  
  21. do{
  22. cout<<"\nPLEASE ENTER YOUR I.D AND PASSWORD TO ENTER IN MAIN MENU_";
  23. cout<<"\n********************************************************************";
  24. cout<<"\nEnter user name: ";
  25. cin>>username;
  26. cout<<"\nEnter the Password: ";
  27. cin>>pass;
  28.  
  29. if(username == "admin" && pass=="admin")
  30. {
  31. cout<<"\t\t\t\t\t******Login Success****** \n\n\n\t\t\t\t******Welcome to MY GARAGE MANAGEMENT_******" <<endl;
  32. loginSuccess =true;
  33.  
  34. }
  35. else
  36. {
  37. cout<<"\n\n ******Login Failed !******";
  38. cout<<"\n\n ******Access Denied !******"<<endl;
  39.  
  40. }
  41. }
  42.  
  43. while (!loginSuccess);
  44.  
  45.  
  46.  
  47.  
  48. system("pause");
  49.  
  50. system("color 7");
  51. system("color 1F");
  52. int a;
  53. int u_input; //declairing an integer to take input value from user
  54. int amount=0 , count=0; //declairing two integers 1.for total amount 2.for count of total vehicals parked
  55. int r=0; //declairing an integer r for rikshaw
  56. int c=0; //declairing an integer c for cars
  57. int b=0; //declairing an integer b for buses
  58.  
  59. start(); //calling the function start...
  60.  
  61. menu(); //calling the function menu...
  62.  
  63. note(); //calling the function note...
  64.  
  65. input(); //calling the function input...
  66.  
  67. mainfunc(); //calling the function mainfunc...
  68.  
  69. return 0;
  70. }
  71.  
  72. void start() //defining the start function
  73. {
  74. //body of the start function
  75.  
  76. //start print... Welcome and apllication title print....
  77. cout<<"PROJECT BY : MEHRAN MEMON (K-18SW28) AHMED AZIZ MALIK (K-18SW35) ASSIGNED BY: DR. NOMAN QADEER SOOMRO "<<endl;
  78. cout<<"----------------------------------------------------------------------------------------------------------------" <<endl;
  79. cout<<"\t\t\t\tWelcome to" <<endl;
  80. cout<<"\t\t\t MY GARAGE MANAGEMENT APPLICATION" <<endl;
  81. cout<<"________________________________________________________________________________________________________________" <<endl;
  82.  
  83. }
  84. void menu() //defining the menu function
  85. {
  86. //body of the menu function
  87.  
  88. //menu and rate table...
  89. cout<<"-------------------------------------------------------------------------------------------------------------" <<endl;
  90. cout<<"\t\t\tVEHICALS PARKING RENT AND WASHING COST LIST " <<endl;
  91. cout<<"\n\nFOR A RIKSHAW IS = 300 " <<endl;
  92. cout<<"FOR A CAR IS = 700 " <<endl;
  93. cout<<"FOR A BUS IS = 1000 \n\n" <<endl;
  94. cout<<"-------------------------------------------------------------------------------------------------------------" <<endl;
  95.  
  96.  
  97. }
  98.  
  99. void note() //defining the note function
  100. {
  101. //body of the note function
  102.  
  103. //notification of the parking lot capacity....
  104. cout<<"\n\nNOTE:" <<endl;
  105. cout<<"THERE IS CAPACITY OF ONLY 50 VEHICALS' PARKING. SO, YOU CAN ONLY PARK 50 VEHICALS...." <<endl;
  106.  
  107.  
  108. }
  109.  
  110. void input() //defining the input function
  111. {
  112. //body of the input function
  113.  
  114. //printing the input menu for user....
  115. cout<<"\n\nPress 1 for Entry of Rikshaw..." <<endl;
  116. cout<<"Press 2 for Entry of Car..." <<endl;
  117. cout<<"Press 3 for Entry of Bus..." <<endl;
  118. cout<<"Press 4 to get the entered Record..." <<endl;
  119. cout<<"Press 5 to DELETE whole record" <<endl;
  120. cout<<"Press 6 to See the remaining space left for vehicles...." <<endl;
  121. }
  122. void mainfunc() //defining the mainfunc function
  123. {
  124. //body of the mainfunc function
  125.  
  126. int u_input; //declairing an integer to take input value from user
  127. int amount=0 , count=0; //declairing two integers 1.for total amount 2.for count of total vehicals parked
  128. int r=0; //declairing an integer r for rikshaw
  129. int c=0; //declairing an integer c for cars
  130. int b=0; //declairing an integer b for buses
  131.  
  132. //using the while loop so that the programs runs repeatedly....
  133. while(true)
  134. {
  135.  
  136. cout<<"\n\nPress any Number = " ; //cout before taking input from user...
  137. cin>>u_input; cout<<endl;
  138. if(u_input == 1) // use of if-else statement
  139. {
  140. //body of the if-else statement...
  141. cout<<"-----------------------------------------" <<endl;
  142. cout<<"YOU ENTERED NUMBER (1) " <<endl;
  143. cout<<"THERE IS ENTRY OF A RIKSHAW ....." <<endl;
  144. cout<<"-----------------------------------------" <<endl;
  145. }
  146. else
  147. if(u_input==2) //if-else statement continues...
  148. {
  149. cout<<"-----------------------------------------" <<endl;
  150. cout<<"YOU ENTERED NUMBER (2) " <<endl;
  151. cout<<"THERE IS ENTRY OF A CAR ....." <<endl;
  152. cout<<"-----------------------------------------" <<endl;
  153. }
  154. else
  155. if(u_input ==3) //if-else statement continues...
  156. {
  157. cout<<"-----------------------------------------" <<endl;
  158. cout<<"YOU ENTERED NUMBER (3) " <<endl;
  159. cout<<"THERE IS ENTRY OF A BUS ....." <<endl;
  160. cout<<"-----------------------------------------" <<endl;
  161. }
  162. else
  163. if(u_input==4) //if-else statement continues...
  164. {
  165. cout<<"-----------------------------------------" <<endl;
  166. cout<<"YOU ENTERED NUMBER (4) " <<endl;
  167. cout<<"YOU WANT TO SEE THE TOTAL RECORD...." <<endl;
  168. cout<<"-----------------------------------------" <<endl;
  169. }
  170. else
  171. if(u_input==5) //if-else statement continues...
  172. {
  173. cout<<"-----------------------------------------" <<endl;
  174. cout<<"YOU ENTERED NUMBER (5) " <<endl;
  175. cout<<"YOU WANT TO DELETE THE TOTAL RECORD...." <<endl;
  176. cout<<"-----------------------------------------" <<endl;
  177. }
  178. else
  179. if(u_input==6) //if-else statement continues...
  180. {
  181. cout<<"-----------------------------------------" <<endl;
  182. cout<<"YOU ENTERED NUMBER (6) " <<endl;
  183. cout<<"YOU WANT TO SEE THE REMAINING SPACE LEFT FOR VEHICLES...." <<endl;
  184. cout<<"-----------------------------------------" <<endl;
  185. }
  186.  
  187. {
  188.  
  189.  
  190. if (u_input==1) //defines that if the user inserts number 1...
  191. {
  192. //using the if-else statement for giving the maximum range of 50 vehicals...
  193. if(count<50)
  194.  
  195. {
  196. r=r+1; //simple increment of the rikshaws...
  197. amount = amount+100; //adding the amount per vehical as it increases...
  198. count = count +1; //addition in the count of the rikshaws.....
  199. }
  200. //if 50 vehicals are parked then it shows the notification....
  201. else
  202. cout<<"###### GARAGE AREA IS FULL..... ######" <<endl; //Notification...
  203. cout<<"\n##############################" <<endl;
  204. }
  205.  
  206. else if(u_input==2) //defines that if the user inserts number 2...
  207. {
  208. //using the if-else statement for giving the maximum range of 50 vehicals...
  209. if(count<50)
  210. {
  211. c++; //simple increment of the cars...
  212. amount = amount+200; //adding the amount per vehical as it increases...
  213. count = count+1; //addition in the count of the cars.....
  214. }
  215. //if 50 vehicals are parked then it shows the notification....
  216. else
  217. cout<<"###### GARAGE AREA IS FULL..... ######" <<endl; //Notification...
  218. cout<<"\n##############################" <<endl;
  219. }
  220. else if(u_input==3) //defines that if the user inserts number 3...
  221. {
  222. //using the if-else statement for giving the maximum range of 50 vehicals...
  223. if(count<50)
  224. {
  225. b++; //simple increment of the buses...
  226. amount = amount+300; //adding the amount per vehical as it increases...
  227. count = count+1; //addition in the count of the buses.....
  228. }
  229. //if 50 vehicals are parked then it shows the notification....
  230. else
  231. cout<<"###### GARAGE AREA IS FULL.... ######" <<endl; //Notification...
  232. cout<<"\n##############################" <<endl;
  233. }
  234. else if(u_input==4) //defines that if the user inserts number 4...
  235. {
  236.  
  237. cout<<"\n'''''''TOTAL RECORD IS SHOWN '''''''" <<endl;
  238. cout<<"----------------------------------------------------" <<endl;
  239. cout<<"\nThe total amount is = " <<amount <<endl <<endl; //print with the total amount or rupees earned
  240. cout<<"----------------------------------------------------" <<endl;
  241. cout<<"\nThe total number of vehicals parked and serviced = " <<count <<endl <<endl; //print of total vehicals parked
  242. cout<<"----------------------------------------------------" <<endl;
  243. cout<<"\nThe total number of Rikshaws parked and serviced is = " <<r <<endl <<endl; //print of total rikshaws parked
  244. cout<<"----------------------------------------------------" <<endl;
  245. cout<<"\nThe total number of Cars parked and serviced is = " <<c <<endl <<endl; //print of total cars parked
  246. cout<<"----------------------------------------------------" <<endl;
  247. cout<<"\nThe total number of Buses parked and serviced is = " <<b <<endl <<endl; //print of total buses parked
  248. cout<<"----------------------------------------------------" <<endl;
  249.  
  250. }
  251. else if(u_input ==5) //defines that if the user inserts number 5...
  252. {
  253. cout<<"\n****************************" <<endl;
  254. cout<<"\nRECORD DELETED...... \n" <<endl;
  255. cout<<"____________________________________" <<endl;
  256. cout<<"\nYOU CAN ENTER A NEW RECORD.....\n" <<endl;
  257. cout<<"****************************" <<endl;
  258. amount =0; //no record or record deleted for AMOUNT
  259. count =0; //no record or record deleted for COUNT
  260. r=0; //no record or record deleted for RIKSHAWS
  261. c=0; //no record or record deleted for CARS
  262. b=0; //no record or record deleted for BUSES
  263. }
  264. else if(u_input == 6) //defines that if the user inserts number 6...
  265. {
  266. int z;
  267. z=50 - count;
  268. cout<<"\nThe Remaining Space in the Garage is for (" <<z <<") Vehicles" <<endl;
  269. cout<<"________________________________________________________________________________" <<endl;
  270.  
  271. }
  272.  
  273. else
  274. {
  275. cout<<"********************************" <<endl;
  276. cout<<"\nInvalid Number Entered... " <<endl; //it prints when you enter number excpet 1-6
  277. cout<<"_________________________________" <<endl;
  278. cout<<"\nRETRY WITH A VALID NUMBER....\n" <<endl; //it prints to notify that you didn't entered value from 1-6
  279. cout<<"_________________________________" <<endl;
  280. cout<<"You must enter the number 1-6...\n" <<endl; //it prints to request that enter number from 1-6...
  281. cout<<"********************************" <<endl;
  282. }
  283.  
  284. }
  285.  
  286. }
  287. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement