Skip to content
Snippets Groups Projects
Commit 65383d40 authored by mgy20's avatar mgy20
Browse files

Muriki foi embora

parent f6e9b6a4
No related branches found
No related tags found
No related merge requests found
...@@ -48,14 +48,14 @@ int show_options() { ...@@ -48,14 +48,14 @@ int show_options() {
if (cin.fail()) { if (cin.fail()) {
cin.clear(); // Clear the error flag cin.clear(); // Clear the error flag
cin.ignore(numeric_limits<streamsize>::max(), '\n'); // Ignore the invalid input cin.ignore(numeric_limits<streamsize>::max(), '\n'); // Ignore the invalid input
cout << "Entrada inválida! Por favor, insira um número entre 1 e 10." << endl; cout << "> Entrada inválida! Por favor, insira um número entre 1 e 10." << endl;
continue; // Restart the loop continue; // Restart the loop
} }
// Check if the option is within the valid range // Check if the option is within the valid range
if (option >= 1 && option <= 10) { break; } // Valid option, exit the loop if (option >= 1 && option <= 10) { break; } // Valid option, exit the loop
else { else {
cout << "Opção inválida! Por favor, insira um número entre 1 e 10." << endl; cout << "> Opção inválida! Por favor, insira um número entre 1 e 10." << endl;
} }
} }
...@@ -126,9 +126,7 @@ int main(){ ...@@ -126,9 +126,7 @@ int main(){
if (valor > 0) { if (valor > 0) {
cout << "\nUsuario: " << userCPF << endl; cout << "\nUsuario: " << userCPF << endl;
cout << "Valor a pagar: " << valor << endl; cout << "Valor a pagar: " << valor << endl;
} else { } else { cout << "> Aviso: Usuario não possui multas" << endl; }
cout << "> Aviso: Usuario não possui multas" << endl;
}
break; break;
case PAYFEES: case PAYFEES:
...@@ -153,9 +151,7 @@ int main(){ ...@@ -153,9 +151,7 @@ int main(){
cout << "Entre com o editora: "; getline(cin, editora); cout << "Entre com o editora: "; getline(cin, editora);
Livro liv(titulo, ano, autor, editora); Livro liv(titulo, ano, autor, editora);
contObras.adicionarObra(liv); contObras.adicionarObra(liv);
} else { } else { cout << "Erro: Tipo não recinhecido! Ignorando operação" << endl; }
cout << "Erro: Tipo não recinhecido! Ignorando operação" << endl;
}
break; break;
case LISTWORKS: contObras.mostrarDetalhes(); case LISTWORKS: contObras.mostrarDetalhes();
...@@ -169,9 +165,7 @@ int main(){ ...@@ -169,9 +165,7 @@ int main(){
} else if (tipoObra == "livro") { } else if (tipoObra == "livro") {
cout << "Método de busca (titulo|autor): "; cout << "Método de busca (titulo|autor): ";
cin >> tipoBusca; cin >> tipoBusca;
} else { } else { cout << "Erro: Tipo não reconhecido! Ignorando operação" << endl; }
cout << "Erro: Tipo não reconhecido! Ignorando operação" << endl;
}
//contObras.pesquisarObra(DescricaoObra &descricao); //contObras.pesquisarObra(DescricaoObra &descricao);
break; break;
...@@ -191,9 +185,7 @@ int main(){ ...@@ -191,9 +185,7 @@ int main(){
cout << "Entre com o editora: "; getline(cin, editora); cout << "Entre com o editora: "; getline(cin, editora);
Livro liv(titulo, ano, autor, editora); Livro liv(titulo, ano, autor, editora);
contObras.solicitarEmprestimo(liv); contObras.solicitarEmprestimo(liv);
} else { } else { cout << "Erro: Tipo não reconhecido! Ignorando operação" << endl; }
cout << "Erro: Tipo não reconhecido! Ignorando operação" << endl;
}
break; break;
case RETURNWORK: case RETURNWORK:
...@@ -212,9 +204,7 @@ int main(){ ...@@ -212,9 +204,7 @@ int main(){
cout << "Entre com o editora: "; getline(cin, editora); cout << "Entre com o editora: "; getline(cin, editora);
Livro liv(titulo, ano, autor, editora); Livro liv(titulo, ano, autor, editora);
contObras.devolverEmprestimo(liv); contObras.devolverEmprestimo(liv);
} else { } else { cout << "Erro: Tipo não reconhecido! Ignorando operação" << endl; }
cout << "Erro: Tipo não reconhecido! Ignorando operação" << endl;
}
break; break;
case FINISH: case FINISH:
...@@ -222,7 +212,7 @@ int main(){ ...@@ -222,7 +212,7 @@ int main(){
return 0; return 0;
default: default:
cout << "Comando não reconhecido!" << endl; cout << "> Comando não reconhecido!" << endl;
break; break;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment