Search
 
SCRIPT & CODE EXAMPLE
 

CPP

parking charge system project c++

#include<iostream>
#include<Windows.h>
using namespace std;

struct info
{
	string type;
	string model;
	int vNo;
}s;

void menu();
void car();
void bus();
void motorcycle();

int main()
{
	int n;
	cout << "				 ================================
";
	cout << "				|Welcome to parking charge system|
";
	cout << "				 ================================

";
	do
	{
		menu();
		int choice;
		cout << "
				enter choice: ";
		cin >> choice;
		cout << "				----------------------------------
";
		switch (choice)
		{
		case 1:
			car();
			break;
		case 2:
			bus();
			break;
		case 3:
			motorcycle();
			break;
		default:
			cout << "				please, choose from menu.
";
			break;
		}
		cout << "

				press...-1 to end program: ";
		cin >> n;
	} while (n != -1);
	return 0;
}
//menu
void menu()
{
	cout << "				----------------------------------
";
	cout << "				press..1 to enter car.
";
	cout << "				press..2 to enter bus.
";
	cout << "				press..3 to enter motorcycle.
";
	cout << "				----------------------------------
";
}
//car
void car()
{
	system("cls");
	cout << "				enter type of car: ";
	cin >> s.type;
	cout << "				enter model of car: ";
	cin >> s.model;
	cout << "				enter V_NO of car: ";
	cin >> s.vNo;
	cout << "				";
	for (int i = 0; i < 10; i++)
	{
		cout << ".";
		Sleep(1000);
	}
	cout << "
				car is added
";
	cout << "				 ----------------------------------
";
	cout << "				|Ticket:
";
	cout << "				|
";
	cout << "				|car type: " << s.type << "
";
	cout << "				|car model: " << s.model << "
";
	cout << "				|car v_no: " << s.vNo << "
";
	cout << "				|
";
	cout << "				|price: 20 $
";
	cout << "				 ----------------------------------
";
}
//bus
void bus()
{
	system("cls");
	cout << "				enter type of bus: ";
	cin >> s.type;
	cout << "				enter model of bus: ";
	cin >> s.model;
	cout << "				enter V_NO of bus: ";
	cin >> s.vNo;
	cout << "				";
	for (int i = 0; i < 10; i++)
	{
		cout << ".";
		Sleep(1000);
	}
	cout << "
				bus is added
";
	cout << "				 ----------------------------------
";
	cout << "				|Ticket:
";
	cout << "				|
";
	cout << "				|bus type: " << s.type << "
";
	cout << "				|bus model: " << s.model << "
";
	cout << "				|bus v_no: " << s.vNo << "
";
	cout << "				|
";
	cout << "				|price: 40 $
";
	cout << "				 ----------------------------------
";
}
//motorcycle
void motorcycle()
{
	system("cls");
	cout << "				enter type of motorcycle: ";
	cin >> s.type;
	cout << "				enter model of motorcycle: ";
	cin >> s.model;
	cout << "				enter V_NO of motorcycle: ";
	cin >> s.vNo;
	cout << "				";
	for (int i = 0; i < 10; i++)
	{
		cout << ".";
		Sleep(1000);
	}
	cout << "
				motorcycle is added
";
	cout << "				 ----------------------------------
";
	cout << "				|Ticket:
";
	cout << "				|
";
	cout << "				|motorcycle type: " << s.type << "
";
	cout << "				|motorcycle model: " << s.model << "
";
	cout << "				|motorcycle v_no: " << s.vNo << "
";
	cout << "				|
";
	cout << "				|price: 10 $
";
	cout << "				 ----------------------------------
";
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: print all variables separated by comma c++ 
Cpp :: c++ round number to 2 decimal places 
Cpp :: no of balanced substrings 
Cpp :: warning: base will be initialized after 
Cpp :: person parametr cpp 
Cpp :: right rotation of array in c++ by one element 
Cpp :: variable modulus 5 meaning in c++ 
Cpp :: c++ take n number from the user and store them in array and get the max, min number of them and also find the average/summation of these numbers 
Cpp :: the number of ones int bitset 
Cpp :: c++ to mips converter online 
Cpp :: mpi wait 
Cpp :: decemal representation 
Cpp :: coin change top-down 
Cpp :: CodeChef Starters 30 Division 4 (Rated) Swapping Chefs Way 
Cpp :: c++ terinary operator 
Cpp :: create dynamic variable c++ 
Cpp :: convert into acsii c++ 
Cpp :: stack algorithm in c++ 
Cpp :: assegnare valori in c++ 
Cpp :: dfs in tree using adjacency list 
Cpp :: sfml hide message 
Cpp :: flutter container margin 
Cpp :: c++ program to convert time in seconds to hours minutes and seconds 
Cpp :: [3,2,4,-1,-4] 
Cpp :: initialize many variablles c++ 
Cpp :: program in c++ for simple interest rate 
Cpp :: interactive problem 
Cpp :: decising how many numbers after comma c++ 
Cpp :: c++ to assembly 
Cpp :: subsets of a given array 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =