Codigo Estacionamento
Casos: Codigo Estacionamento. Pesquise 862.000+ trabalhos acadêmicosPor: Aszunrus • 19/11/2014 • 369 Palavras (2 Páginas) • 296 Visualizações
#include <iostream>
#include <iomanip>
#include <cmath>
#include <ctime>
using std::cout;
using std::cin;
using std::endl;
using std::ios;
using std::fixed;
using std::setw;
using std::setiosflags;
using std::setprecision;
//function prototype
double calculateCharge(double);
int main()
{
int type;
int space;
while ( space<= 10 )
{
cout << "Are you a car or bike? Press 1 for car and 2 for bike.";
cin >>type;
switch (type)
{
case 1:;
{
// current date/time based on current system
time_t now = time(0);
// convert now to string form
char* dt = ctime(&now);
cout << "Please take your receipt.";
cout << "\nThe date and time of your entrance is: " << dt << endl;
// plate # is imported from camera or from security
cout << "Your plate # is: XXXXXX \n";
space = space +1;
//space left
cout<< "Spaces used "<<space;
cout << "\n";
break;
}
case 2:;
{
time_t now = time(0);
char* dt = ctime(&now);
cout << "Welcome, enjoy free parking!";
cout << "\nThe date and time of your entrance is: \n" << dt << endl;
return(0);
break;
}
}
int num;
int count = 1;
{
time_t now = time(0);
...