Tuesday, January 11, 2022

Car Parking Management Program in C++

This is a Character based User Interface or CUI based simple computerized solution to manage the system activities. This prototype code saves time and energy of its user by automating certain tasks. This system is either file handling type or ROM type, and stores activities in a coder-defined file or on ROM memory temporarily.

C++ is a typed language, so no need of code explanation as everything will be cleared by itself by reading the code. If you know C++, you know this code. It’s that simple!

Note to students, draw a class diagram and flow chart of system by reading the code itself. The Code::Blocks IDE 20.03+MinGW and Cygwin tool are used to test the code.

Note that some systems are very simple and need enhancement but they are complete on their own in other terms.

 

CarParkingManagementProgram.cpp

 

 

 

 

#include<iostream>

 

using namespace std;

 

main()

{

    cout<<"\n\t\tC A R  P A R K I N G"<<endl<<endl;

    int enter;

    int car=0,bike=0,rikshaw=0;

    while(true)

    {

        cout<<"Press 1 to enter car"<<endl;

        cout<<"Press 2 to enter bike"<<endl;

        cout<<"Press 3 to enter rikshaw"<<endl;

        cout<<"Press 4 to show the record"<<endl;

        cout<<"Press 5 to delete the record"<<endl;

        cout<<"Press 6 to exit"<<endl;

        cin>>enter;

        if(enter==1)

        {

            car++;

            cout<<"Car is added"<<endl;

        }

        else if(enter==2)

        {

            bike++;

            cout<<"Bike is added"<<endl;

        }

        else if(enter==3)

        {

            rikshaw++;

            cout<<"Rikshaw is added"<<endl;

        }

        else if(enter==4)

        {

            cout<<"\n---Data---"<<endl<<endl;

            cout<<"Cars: "<<car<<endl;

            cout<<"Bikes: "<<bike<<endl;

            cout<<"Rikshaws: "<<rikshaw<<endl;

        }

        else if(enter==5)

        {

            car=0;

            bike=0;

            rikshaw=0;

            cout<<"\nYour Record is deleted"<<endl<<endl;

        }

        else if(enter==6)

        {

            exit(0);

        }

    }

}

 

 

 

For more C/C++ codes related information click here.

…till next post, bye-bye and take care.

 


No comments:

Post a Comment