Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <iostream>
- using namespace std;
- void start(); //declairing the START function
- void menu(); //declairing the MENU function
- void note(); //declairing the NOTE function
- void input(); //declairing the INPUT function
- void mainfunc(); //declairing the MAINFUNCTION function
- int main()
- {
- system ("color 7");
- system ("color 2F");
- string username = "";
- string pass = "";
- bool loginSuccess = false;
- cout<<"\n";
- cout<<"\t\t=====WELCOME TO THE GARAGE MANAGEMENT APP=====\n";
- do{
- cout<<"\nPLEASE ENTER YOUR I.D AND PASSWORD TO ENTER IN MAIN MENU_";
- cout<<"\n********************************************************************";
- cout<<"\nEnter user name: ";
- cin>>username;
- cout<<"\nEnter the Password: ";
- cin>>pass;
- if(username == "admin" && pass=="admin")
- {
- cout<<"\t\t\t\t\t******Login Success****** \n\n\n\t\t\t\t******Welcome to MY GARAGE MANAGEMENT_******" <<endl;
- loginSuccess =true;
- }
- else
- {
- cout<<"\n\n ******Login Failed !******";
- cout<<"\n\n ******Access Denied !******"<<endl;
- }
- }
- while (!loginSuccess);
- system("pause");
- system("color 7");
- system("color 1F");
- int a;
- int u_input; //declairing an integer to take input value from user
- int amount=0 , count=0; //declairing two integers 1.for total amount 2.for count of total vehicals parked
- int r=0; //declairing an integer r for rikshaw
- int c=0; //declairing an integer c for cars
- int b=0; //declairing an integer b for buses
- start(); //calling the function start...
- menu(); //calling the function menu...
- note(); //calling the function note...
- input(); //calling the function input...
- mainfunc(); //calling the function mainfunc...
- return 0;
- }
- void start() //defining the start function
- {
- //body of the start function
- //start print... Welcome and apllication title print....
- cout<<"PROJECT BY : MEHRAN MEMON (K-18SW28) AHMED AZIZ MALIK (K-18SW35) ASSIGNED BY: DR. NOMAN QADEER SOOMRO "<<endl;
- cout<<"----------------------------------------------------------------------------------------------------------------" <<endl;
- cout<<"\t\t\t\tWelcome to" <<endl;
- cout<<"\t\t\t MY GARAGE MANAGEMENT APPLICATION" <<endl;
- cout<<"________________________________________________________________________________________________________________" <<endl;
- }
- void menu() //defining the menu function
- {
- //body of the menu function
- //menu and rate table...
- cout<<"-------------------------------------------------------------------------------------------------------------" <<endl;
- cout<<"\t\t\tVEHICALS PARKING RENT AND WASHING COST LIST " <<endl;
- cout<<"\n\nFOR A RIKSHAW IS = 300 " <<endl;
- cout<<"FOR A CAR IS = 700 " <<endl;
- cout<<"FOR A BUS IS = 1000 \n\n" <<endl;
- cout<<"-------------------------------------------------------------------------------------------------------------" <<endl;
- }
- void note() //defining the note function
- {
- //body of the note function
- //notification of the parking lot capacity....
- cout<<"\n\nNOTE:" <<endl;
- cout<<"THERE IS CAPACITY OF ONLY 50 VEHICALS' PARKING. SO, YOU CAN ONLY PARK 50 VEHICALS...." <<endl;
- }
- void input() //defining the input function
- {
- //body of the input function
- //printing the input menu for user....
- cout<<"\n\nPress 1 for Entry of Rikshaw..." <<endl;
- cout<<"Press 2 for Entry of Car..." <<endl;
- cout<<"Press 3 for Entry of Bus..." <<endl;
- cout<<"Press 4 to get the entered Record..." <<endl;
- cout<<"Press 5 to DELETE whole record" <<endl;
- cout<<"Press 6 to See the remaining space left for vehicles...." <<endl;
- }
- void mainfunc() //defining the mainfunc function
- {
- //body of the mainfunc function
- int u_input; //declairing an integer to take input value from user
- int amount=0 , count=0; //declairing two integers 1.for total amount 2.for count of total vehicals parked
- int r=0; //declairing an integer r for rikshaw
- int c=0; //declairing an integer c for cars
- int b=0; //declairing an integer b for buses
- //using the while loop so that the programs runs repeatedly....
- while(true)
- {
- cout<<"\n\nPress any Number = " ; //cout before taking input from user...
- cin>>u_input; cout<<endl;
- if(u_input == 1) // use of if-else statement
- {
- //body of the if-else statement...
- cout<<"-----------------------------------------" <<endl;
- cout<<"YOU ENTERED NUMBER (1) " <<endl;
- cout<<"THERE IS ENTRY OF A RIKSHAW ....." <<endl;
- cout<<"-----------------------------------------" <<endl;
- }
- else
- if(u_input==2) //if-else statement continues...
- {
- cout<<"-----------------------------------------" <<endl;
- cout<<"YOU ENTERED NUMBER (2) " <<endl;
- cout<<"THERE IS ENTRY OF A CAR ....." <<endl;
- cout<<"-----------------------------------------" <<endl;
- }
- else
- if(u_input ==3) //if-else statement continues...
- {
- cout<<"-----------------------------------------" <<endl;
- cout<<"YOU ENTERED NUMBER (3) " <<endl;
- cout<<"THERE IS ENTRY OF A BUS ....." <<endl;
- cout<<"-----------------------------------------" <<endl;
- }
- else
- if(u_input==4) //if-else statement continues...
- {
- cout<<"-----------------------------------------" <<endl;
- cout<<"YOU ENTERED NUMBER (4) " <<endl;
- cout<<"YOU WANT TO SEE THE TOTAL RECORD...." <<endl;
- cout<<"-----------------------------------------" <<endl;
- }
- else
- if(u_input==5) //if-else statement continues...
- {
- cout<<"-----------------------------------------" <<endl;
- cout<<"YOU ENTERED NUMBER (5) " <<endl;
- cout<<"YOU WANT TO DELETE THE TOTAL RECORD...." <<endl;
- cout<<"-----------------------------------------" <<endl;
- }
- else
- if(u_input==6) //if-else statement continues...
- {
- cout<<"-----------------------------------------" <<endl;
- cout<<"YOU ENTERED NUMBER (6) " <<endl;
- cout<<"YOU WANT TO SEE THE REMAINING SPACE LEFT FOR VEHICLES...." <<endl;
- cout<<"-----------------------------------------" <<endl;
- }
- {
- if (u_input==1) //defines that if the user inserts number 1...
- {
- //using the if-else statement for giving the maximum range of 50 vehicals...
- if(count<50)
- {
- r=r+1; //simple increment of the rikshaws...
- amount = amount+100; //adding the amount per vehical as it increases...
- count = count +1; //addition in the count of the rikshaws.....
- }
- //if 50 vehicals are parked then it shows the notification....
- else
- cout<<"###### GARAGE AREA IS FULL..... ######" <<endl; //Notification...
- cout<<"\n##############################" <<endl;
- }
- else if(u_input==2) //defines that if the user inserts number 2...
- {
- //using the if-else statement for giving the maximum range of 50 vehicals...
- if(count<50)
- {
- c++; //simple increment of the cars...
- amount = amount+200; //adding the amount per vehical as it increases...
- count = count+1; //addition in the count of the cars.....
- }
- //if 50 vehicals are parked then it shows the notification....
- else
- cout<<"###### GARAGE AREA IS FULL..... ######" <<endl; //Notification...
- cout<<"\n##############################" <<endl;
- }
- else if(u_input==3) //defines that if the user inserts number 3...
- {
- //using the if-else statement for giving the maximum range of 50 vehicals...
- if(count<50)
- {
- b++; //simple increment of the buses...
- amount = amount+300; //adding the amount per vehical as it increases...
- count = count+1; //addition in the count of the buses.....
- }
- //if 50 vehicals are parked then it shows the notification....
- else
- cout<<"###### GARAGE AREA IS FULL.... ######" <<endl; //Notification...
- cout<<"\n##############################" <<endl;
- }
- else if(u_input==4) //defines that if the user inserts number 4...
- {
- cout<<"\n'''''''TOTAL RECORD IS SHOWN '''''''" <<endl;
- cout<<"----------------------------------------------------" <<endl;
- cout<<"\nThe total amount is = " <<amount <<endl <<endl; //print with the total amount or rupees earned
- cout<<"----------------------------------------------------" <<endl;
- cout<<"\nThe total number of vehicals parked and serviced = " <<count <<endl <<endl; //print of total vehicals parked
- cout<<"----------------------------------------------------" <<endl;
- cout<<"\nThe total number of Rikshaws parked and serviced is = " <<r <<endl <<endl; //print of total rikshaws parked
- cout<<"----------------------------------------------------" <<endl;
- cout<<"\nThe total number of Cars parked and serviced is = " <<c <<endl <<endl; //print of total cars parked
- cout<<"----------------------------------------------------" <<endl;
- cout<<"\nThe total number of Buses parked and serviced is = " <<b <<endl <<endl; //print of total buses parked
- cout<<"----------------------------------------------------" <<endl;
- }
- else if(u_input ==5) //defines that if the user inserts number 5...
- {
- cout<<"\n****************************" <<endl;
- cout<<"\nRECORD DELETED...... \n" <<endl;
- cout<<"____________________________________" <<endl;
- cout<<"\nYOU CAN ENTER A NEW RECORD.....\n" <<endl;
- cout<<"****************************" <<endl;
- amount =0; //no record or record deleted for AMOUNT
- count =0; //no record or record deleted for COUNT
- r=0; //no record or record deleted for RIKSHAWS
- c=0; //no record or record deleted for CARS
- b=0; //no record or record deleted for BUSES
- }
- else if(u_input == 6) //defines that if the user inserts number 6...
- {
- int z;
- z=50 - count;
- cout<<"\nThe Remaining Space in the Garage is for (" <<z <<") Vehicles" <<endl;
- cout<<"________________________________________________________________________________" <<endl;
- }
- else
- {
- cout<<"********************************" <<endl;
- cout<<"\nInvalid Number Entered... " <<endl; //it prints when you enter number excpet 1-6
- cout<<"_________________________________" <<endl;
- cout<<"\nRETRY WITH A VALID NUMBER....\n" <<endl; //it prints to notify that you didn't entered value from 1-6
- cout<<"_________________________________" <<endl;
- cout<<"You must enter the number 1-6...\n" <<endl; //it prints to request that enter number from 1-6...
- cout<<"********************************" <<endl;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement