Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int estacionamento [0][0];
- int menu();
- void listar_vagas();
- bool remover_carro(int id_do_carro);
- bool estacionar(char tipo_de_carro);
- bool verifica_vaga_diponivel(int andar);
- int main(){
- int const ANDAR = 2;
- int const VAGAS = 10;
- int estacionamento [ANDAR][VAGAS];
- menu();
- return 0;
- }
- bool estacionar(int tipo_de_carro){
- return true;
- }
- bool remover_carro(int id_do_carro){
- return true;
- }
- void listar_vagas(){
- for(int x=1; x<3; x++){
- cout << "ANDAR >>>> "<< x << " | ";
- for(int y=0; y<10; y++){
- estacionamento[x][y]=0;
- cout<<" "<< estacionamento[x][y] << " ";
- }
- cout<<endl;
- }
- }
- int menu(){
- int opt;
- cout << "[1]- ***LISTAR ****" << endl;
- cout << "[2]- **ESTACIONAR**" << endl;
- cout << "[3]- ****REMOVER***" << endl;
- cin>>opt;
- switch(opt){
- case 1:
- cout << endl;
- cout << endl;
- cout << endl;
- listar_vagas();
- cout << endl;
- cout << endl;
- cout << endl;
- menu();
- break;
- case 2:
- int TipoCarro;
- int index=0;
- int vagaOcupada=1;
- cout<<"Informe o tipo do veículo? "<<endl;
- cout<<"1 - CARRO"<<endl;
- cout<<"2 - CAMINHÃO"<<endl;
- cin>>TipoCarro;
- if(verifica_vaga_diponivel(1)){
- }
- menu();
- break;
- }
- }
- bool verifica_vaga_diponivel(int andar){
- int vagaLivre=0;
- for(int y=0; y<10; y++){
- if(estacionamento[andar][y] == 0){
- vagaLivre++;
- }
- }
- if(vagaLivre>0)
- return true;
- else
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment