programa de gerenciamento da compra de um carro em C++

atividade estruturada de algorítmico

programa de gerenciamento da compra de um carro em C++ com retorno, menu e finalização de acordo com usuário.

#include <iostream>
#include <string>
using namespace std;
int main()
{
    int carro,num1,num2,opcao,contador,res;
    char resposta,escolha;
    string marca,resposta1;
    double Valor,IPI,taxa,total;
               
    IPI = 0.08;
    inicio:
    cout<< "\n-----------------------------------------------------\n";
    cout<< "\n----------Sistema de vendas online-------------------\n";
    cout<< "\n-----------------------------------------------------\n";
    cout<< "\nEscolha o tipo de carro que deseja :\n";
    cout<< "\n1 Apollo GL 1.8 / 2 Gol GL / 3 Gol 16v / 4 Polo GT\n";
    cin>> carro;
    switch (carro)
    {
           case 1: goto teste;
                                                  break;
                                  case 2: goto teste1;
                                                  break;
                                  case 3: goto teste2;
                                                  break;
                                  case 4: goto teste3;
                                                               break;
                                                  teste:
                                                  Valor = 5742.00;
                                                  marca = "Apollo GL 1.8 ";
              cout << "O automovel escolhido foi "<<marca<<"\n";
              cout << " este e o valor do seu automovel R$ "<< Valor<<"\n";
              cout<< "\n deseja inserir opcionais neste modelo de carro (Sim (1) / Não (0))?";
              cin>> res;
                                                 if (res == 1){
                           cout<< "\nSelecione os opcionais desejados: \n";
                           cout<< "\n 1- Trio Eletrico (Alarme, Vidro e Trava eletrica) R$ 250,00";
                           cout<< "\n 2- Ar-Condicionado R$ 950,00" ;
                           cout<< "\n 3- Direcao hidraulica R$ 385,00";
                           cout<< "\n 4- Completo (itens 1,2 e 3 juntos) R$";
                           cout<< "\n 0- nenhum adicional";
                           cout<< "\nNa compra do modelo completo ganhará um grande desconto\n";
                           cout<< "So pagará acrescimo de 3,5% do valor total com adicional e IPI incluso\n";
                                                                                                 cin>> opcao;
                                                                                                 switch (opcao)
                                                                                                 {
                                                                                                 case 0: cout<< "\nVoce nao selecionou nenhum opcional";
                                  cout<< "\ndeseja finalizar sua compra ? (Sim (1) / Não (0))\n";
                                  cin>> res;
                                                                                                                               if (res == 1){
                                                                                                                               contador = 0;
                                  taxa = Valor * IPI;
                                  total = Valor + taxa;
                                  cout<<"\nValor do seu automovel é R$ "<<Valor;
                                  cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                  cout<<"\nValor total a ser pago é de R$"<<total;
                                  cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                               system("pause");
                                                                                                                               }
                                                                                                                               else{
                                                                                                                               goto inicio;
                                                                                                                               }
                                                                                                                               break;
                                                                                                 case 1:
                                                                                                                 cout<< "\nVoce selecionou o Trio eletrico (alarme, trava, vidro eletrico) R$ 250.00";
                                                                                                                 contador = 1;
                               Valor = Valor + 250.00;
                               taxa = Valor * IPI;
                               total = Valor + taxa;
                               cout<<"\nValor do seu automovel é R$ "<<Valor;
                               cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                               cout<<"\nValor total a ser pago é de R$ "<<total;
                               cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                               cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                               cin>> res;
                                                                                                                 if (res == 1){
                                                                                                                 cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                 system("pause");
                                                                                                                 }
                                                                                                                 else{
                                                                                                                 cout<<"Voce ja selecionou o trio eletrico, selecione outro opcional";
                               cout<< "\n 2- Ar-Condicionado R$ 950,00" ;
                               cout<< "\n 3- Direcao hidraulica R$ 385,00";
                               cin>> opcao;
                                                                                                                 switch (opcao){
                                                                                                                                             case 2:
                                      cout<< "\nVoce selecionou o Ar-condicionado R$ 950.00";
                                      contador = 2;
                                      Valor = Valor + 950.00;
                                      taxa = Valor * IPI;
                                      total = Valor + taxa;
                                      cout<<"\nValor do seu automovel é R$ "<<Valor;
                                      cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                      cout<<"\nValor total a ser pago é de R$ "<<total;
                                      cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                                      cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                                                                                                                                               cin>> res;
                                                                                                                                               if (res == 1){
                                     
                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                               }
                                                                                                                                               else{
                                                                                                                                               parada1:
                                      cout<<"\nVoce ja selecionou o trio eletrico, selecione outro opcional";
                                      cout<< "\nVoce ja selecionou o ar-condicionado, selecione outro opcional";
                                      cout<< "\n 3- Direcao hidraulica R$ 385,00";
                                                                                                                                               cin>> opcao;
                                                                                                                                               switch (opcao){
                                                                                                                                                                            case 3:
                                                                                                                                                               cout<< "\nVoce selecionou a direcao hidraulica R$ 385.00";
                                          contador = 3;
                                          Valor = Valor + 385.00;
                                          taxa = Valor * IPI;
                                          total = Valor + taxa;
                                          cout<<"\nValor do seu automovel é R$ "<<Valor;
                                          cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                          cout<<"\nValor total a ser pago é de R$ "<<total;
                                          cout<<"\ndeseja finalizar a compra ou Voltar ao menu principal ?";
                                          cout<<"\nFinalizar compra (1) - Voltar ao menu principal (0)\n";
                                                                                                                                                               cin>> res;
                                                                                                                                                               if (res == 1){
                                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                                               system("pause");
                                                                                                                                                               }
                                                                                                                                                               else{
                                                                                                                                                               goto inicio;
                                                                                                                                                               }
                                                                                                                                               }
                                                                                                                                               }
                                                                                                                 break;
                                                                                                                 case 3:
                                                                                                                                cout<< "\nVoce selecionou a direcao hidraulica R$ 385.00";
                                      contador = 2;
                                      Valor = Valor + 385.00;
                                      taxa = Valor * IPI;
                                      total = Valor + taxa;
                                      cout<<"\nValor do seu automovel é R$ "<<Valor;
                                      cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                      cout<<"\nValor total a ser pago é de R$ "<<total;
                                      cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                                      cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                                      cin>> res;
                                                                                                                                               if (res == 1){
                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                               system("pause");
                                                                                                                                               }
                                                                                                                                               else{
                                                                                                                                               parada2:
                                      cout<<"\nVoce ja selecionou o trio eletrico, selecione outro opcional";
                                      cout<< "\n 2 - Ar-condicionado R$ 950,00";
                                      cout<< "\n Voce ja selecionou a direcao hidraulica";
                                                                                                                                               cin>> opcao;
                                                                                                                                               switch (opcao){
                                                                                                                                               case 3:
                                                                                                                                                               cout<< "\nVoce selecionou o Ar-condicionado R$ 950.00";
                                          contador = 3;
                                          Valor = Valor + 950.00;
                                          taxa = Valor * IPI;
                                          total = Valor + taxa;
                                          cout<<"\nValor do seu automovel é R$ "<<Valor;
                                          cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                          cout<<"\nValor total a ser pago é de R$ "<<total;
                                          cout<<"\ndeseja finalizar a compra ou Voltar ao menu principal ?";
                                          cout<<"\nFinalizar compra (1) - Voltar ao menu principal (0)\n";
                                                                                                                                                               cin>> res;
                                                                                                                                                               if (res == 1){
                                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                                               system("pause");
                                                                                                                                                               }
                                                                                                                                                               else{
                                                                                                                                                               goto inicio;
                                                                                                                                                               system("pause");
                                                                                                                                                               }

                                                                                                                 }
                                                                                                                 }
                                                                                                                
                                                                                                 }
                                                 }
               
                                                 break;
                                                 case 2: ;
                                                                 teste1:
                                                                 marca = "Gol GL";
                  cout << "O automovel escolhido foi "<<marca<<"\n";
                  Valor = 12377.00;
                  cout << "este e o valor do seu automovel R$ "<< Valor<<"\n";
                  cout<< "\n deseja inserir opcionais neste modelo de carro (Sim (1) / Não (0))?";
              cin>> res;
                                                 if (res == 1){
                           cout<< "\nSelecione os opcionais desejados: \n";
                           cout<< "\n 1- Trio Eletrico (Alarme, Vidro e Trava eletrica) R$ 250,00";
                           cout<< "\n 2- Ar-Condicionado R$ 950,00" ;
                           cout<< "\n 3- Direcao hidraulica R$ 385,00";
                           cout<< "\n 4- Completo (itens 1,2 e 3 juntos) R$";
                           cout<< "\n 0- nenhum adicional";
                           cout<< "\nNa compra do modelo completo ganhará um grande desconto\n";
                           cout<< "So pagará acrescimo de 3,5% do valor total com adicional e IPI incluso\n";
                                                                                                 cin>> opcao;
                                                                                                 switch (opcao)
                                                                                                 {
                                                                                                 case 0: cout<< "\nVoce nao selecionou nenhum opcional";
                                  cout<< "\ndeseja finalizar sua compra ? (Sim (1) / Não (0))\n";
                                  cin>> res;
                                                                                                                               if (res == 1){
                                                                                                                               contador = 0;
                                  taxa = Valor * IPI;
                                  total = Valor + taxa;
                                  cout<<"\nValor do seu automovel é R$ "<<Valor;
                                  cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                  cout<<"\nValor total a ser pago é de R$"<<total;
                                  cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                               system("pause");
                                                                                                                               }
                                                                                                                               else{
                                                                                                                               goto inicio;
                                                                                                                               }
                                                                                                                               break;
                                                                                                 case 1:
                                                                                                                 cout<< "\nVoce selecionou o Trio eletrico (alarme, trava, vidro eletrico) R$ 250.00";
                                                                                                                 contador = 1;
                               Valor = Valor + 250.00;
                               taxa = Valor * IPI;
                               total = Valor + taxa;
                               cout<<"\nValor do seu automovel é R$ "<<Valor;
                               cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                               cout<<"\nValor total a ser pago é de R$ "<<total;
                               cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                               cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                               cin>> res;
                                                                                                                 if (res == 1){
                                                                                                                 cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                 system("pause");
                                                                                                                 }
                                                                                                                 else{
                                                                                                                 cout<<"Voce ja selecionou o trio eletrico, selecione outro opcional";
                               cout<< "\n 2- Ar-Condicionado R$ 950,00" ;
                               cout<< "\n 3- Direcao hidraulica R$ 385,00";
                               cin>> opcao;
                                                                                                                 switch (opcao){
                                                                                                                                             case 2:
                                      cout<< "\nVoce selecionou o Ar-condicionado R$ 950.00";
                                      contador = 2;
                                      Valor = Valor + 950.00;
                                      taxa = Valor * IPI;
                                      total = Valor + taxa;
                                      cout<<"\nValor do seu automovel é R$ "<<Valor;
                                      cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                      cout<<"\nValor total a ser pago é de R$ "<<total;
                                      cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                                      cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                                                                                                                                               cin>> res;
                                                                                                                                               if (res == 1){
                                     
                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                               }
                                                                                                                                               else{
                                                                                                                                               parada3:
                                      cout<<"\nVoce ja selecionou o trio eletrico, selecione outro opcional";
                                      cout<< "\nVoce ja selecionou o ar-condicionado, selecione outro opcional";
                                      cout<< "\n 3- Direcao hidraulica R$ 385,00";
                                                                                                                                               cin>> opcao;
                                                                                                                                               switch (opcao){
                                                                                                                                                                            case 3:
                                                                                                                                                               cout<< "\nVoce selecionou a direcao hidraulica R$ 385.00";
                                          contador = 3;
                                          Valor = Valor + 385.00;
                                          taxa = Valor * IPI;
                                          total = Valor + taxa;
                                          cout<<"\nValor do seu automovel é R$ "<<Valor;
                                          cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                          cout<<"\nValor total a ser pago é de R$ "<<total;
                                          cout<<"\ndeseja finalizar a compra ou Voltar ao menu principal ?";
                                          cout<<"\nFinalizar compra (1) - Voltar ao menu principal (0)\n";
                                                                                                                                                               cin>> res;
                                                                                                                                                               if (res == 1){
                                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                                               system("pause");
                                                                                                                                                               }
                                                                                                                                                               else{
                                                                                                                                                               goto inicio;
                                                                                                                                                               }
                                                                                                                                               }
                                                                                                                                               }
                                                                                                                 break;
                                                                                                                 case 3:
                                                                                                                                cout<< "\nVoce selecionou a direcao hidraulica R$ 385.00";
                                      contador = 2;
                                      Valor = Valor + 385.00;
                                      taxa = Valor * IPI;
                                      total = Valor + taxa;
                                      cout<<"\nValor do seu automovel é R$ "<<Valor;
                                      cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                      cout<<"\nValor total a ser pago é de R$ "<<total;
                                      cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                                      cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                                      cin>> res;
                                                                                                                                               if (res == 1){
                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                               system("pause");
                                                                                                                                               }
                                                                                                                                               else{
                                                                                                                                               parada4:
                                      cout<<"\nVoce ja selecionou o trio eletrico, selecione outro opcional";
                                      cout<< "\n 2 - Ar-condicionado R$ 950,00";
                                      cout<< "\n Voce ja selecionou a direcao hidraulica";
                                                                                                                                               cin>> opcao;
                                                                                                                                               switch (opcao){
                                                                                                                                               case 3:
                                                                                                                                                               cout<< "\nVoce selecionou o Ar-condicionado R$ 950.00";
                                          contador = 3;
                                          Valor = Valor + 950.00;
                                          taxa = Valor * IPI;
                                          total = Valor + taxa;
                                          cout<<"\nValor do seu automovel é R$ "<<Valor;
                                          cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                          cout<<"\nValor total a ser pago é de R$ "<<total;
                                          cout<<"\ndeseja finalizar a compra ou Voltar ao menu principal ?";
                                          cout<<"\nFinalizar compra (1) - Voltar ao menu principal (0)\n";
                                                                                                                                                               cin>> res;
                                                                                                                                                              if (res == 1){
                                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                                               system("pause");
                                                                                                                                                               }
                                                                                                                                                               else{
                                                                                                                                                               goto inicio;
                                                                                                                                                               system("pause");
                                                                                                                                                               }

                                                                                                                 }
                                                                                                                 }
                                                                                                                 }
                                                                                                 }
                                                 }
                                                 }
                                                 break;
                                                 case 3:
                                                                 teste2:
                                                                 Valor = 13745.00;
              marca = "Gol GT 16v";
              cout << "O automovel escolhido foi "<<marca<<"\n";
              cout << " este e o valor do seu automovel R$ "<< Valor<<"\n";
              cout<< "\n deseja inserir opcionais neste modelo de carro (Sim (1) / Não (0))?";
              cin>> res;
                                                 if (res == 1){
                           cout<< "\nSelecione os opcionais desejados: \n";
                           cout<< "\n 1- Trio Eletrico (Alarme, Vidro e Trava eletrica) R$ 250,00";
                           cout<< "\n 2- Ar-Condicionado R$ 950,00" ;
                           cout<< "\n 3- Direcao hidraulica R$ 385,00";
                           cout<< "\n 4- Completo (itens 1,2 e 3 juntos) R$";
                           cout<< "\n 0- nenhum adicional";
                           cout<< "\nNa compra do modelo completo ganhará um grande desconto\n";
                           cout<< "So pagará acrescimo de 3,5% do valor total com adicional e IPI incluso\n";
                                                                                                 cin>> opcao;
                                                                                                 switch (opcao)
                                                                                                 {
                                                                                                 case 0: cout<< "\nVoce nao selecionou nenhum opcional";
                                  cout<< "\ndeseja finalizar sua compra ? (Sim (1) / Não (0))\n";
                                  cin>> res;
                                                                                                                               if (res == 1){
                                                                                                                               contador = 0;
                                  taxa = Valor * IPI;
                                  total = Valor + taxa;
                                  cout<<"\nValor do seu automovel é R$ "<<Valor;
                                  cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                  cout<<"\nValor total a ser pago é de R$"<<total;
                                  cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                               system("pause");
                                                                                                                               }
                                                                                                                               else{
                                                                                                                               goto inicio;
                                                                                                                               }
                                                                                                                               break;
                                                                                                 case 1:
                                                                                                                 cout<< "\nVoce selecionou o Trio eletrico (alarme, trava, vidro eletrico) R$ 250.00";
                                                                                                                 contador = 1;
                               Valor = Valor + 250.00;
                               taxa = Valor * IPI;
                               total = Valor + taxa;
                               cout<<"\nValor do seu automovel é R$ "<<Valor;
                               cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                               cout<<"\nValor total a ser pago é de R$ "<<total;
                               cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                               cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                               cin>> res;
                                                                                                                 if (res == 1){
                                                                                                                 cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                 system("pause");
                                                                                                                 }
                                                                                                                 else{
                                                                                                                 cout<<"Voce ja selecionou o trio eletrico, selecione outro opcional";
                               cout<< "\n 2- Ar-Condicionado R$ 950,00" ;
                               cout<< "\n 3- Direcao hidraulica R$ 385,00";
                               cin>> opcao;
                                                                                                                 switch (opcao){
                                                                                                                                             case 2:
                                      cout<< "\nVoce selecionou o Ar-condicionado R$ 950.00";
                                      contador = 2;
                                      Valor = Valor + 950.00;
                                      taxa = Valor * IPI;
                                      total = Valor + taxa;
                                      cout<<"\nValor do seu automovel é R$ "<<Valor;
                                      cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                      cout<<"\nValor total a ser pago é de R$ "<<total;
                                      cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                                      cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                                                                                                                                               cin>> res;
                                                                                                                                               if (res == 1){
                                     
                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                               system("pause");
                                                                                                                                               }
                                                                                                                                               else{
                                                                                                                                              
                                      cout<<"\nVoce ja selecionou o trio eletrico, selecione outro opcional";
                                      cout<< "\nVoce ja selecionou o ar-condicionado, selecione outro opcional";
                                      cout<< "\n 3- Direcao hidraulica R$ 385,00";
                                                                                                                                               cin>> opcao;
                                                                                                                                               switch (opcao){
                                                                                                                                                                            case 3:
                                                                                                                                                               cout<< "\nVoce selecionou a direcao hidraulica R$ 385.00";
                                          contador = 3;
                                          Valor = Valor + 385.00;
                                          taxa = Valor * IPI;
                                          total = Valor + taxa;
                                          cout<<"\nValor do seu automovel é R$ "<<Valor;
                                          cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                          cout<<"\nValor total a ser pago é de R$ "<<total;
                                          cout<<"\ndeseja finalizar a compra ou Voltar ao menu principal ?";
                                          cout<<"\nFinalizar compra (1) - Voltar ao menu principal (0)\n";
                                                                                                                                                               cin>> res;
                                                                                                                                                               if (res == 1){
                                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                                               system("pause");
                                                                                                                                                               }
                                                                                                                                                               else{
                                                                                                                                                               goto inicio;
                                                                                                                                                               }
                                                                                                                                               }
                                                                                                                                               }
                                                                                                                 break;
                                                                                                                 case 3:
                                                                                                                                cout<< "\nVoce selecionou a direcao hidraulica R$ 385.00";
                                      contador = 2;
                                      Valor = Valor + 385.00;
                                      taxa = Valor * IPI;
                                      total = Valor + taxa;
                                      cout<<"\nValor do seu automovel é R$ "<<Valor;
                                      cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                      cout<<"\nValor total a ser pago é de R$ "<<total;
                                      cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                                      cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                                      cin>> res;
                                                                                                                                               if (res == 1){
                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                               system("pause");
                                                                                                                                               }
                                                                                                                                               else{
                                                                                                                                              
                                      cout<<"\nVoce ja selecionou o trio eletrico, selecione outro opcional";
                                      cout<< "\n 2 - Ar-condicionado R$ 950,00";
                                      cout<< "\n Voce ja selecionou a direcao hidraulica";
                                                                                                                                               cin>> opcao;
                                                                                                                                               switch (opcao){
                                                                                                                                               case 3:
                                                                                                                                                               cout<< "\nVoce selecionou o Ar-condicionado R$ 950.00";
                                          contador = 3;
                                          Valor = Valor + 950.00;
                                          taxa = Valor * IPI;
                                          total = Valor + taxa;
                                          cout<<"\nValor do seu automovel é R$ "<<Valor;
                                          cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                          cout<<"\nValor total a ser pago é de R$ "<<total;
                                          cout<<"\ndeseja finalizar a compra ou Voltar ao menu principal ?";
                                          cout<<"\nFinalizar compra (1) - Voltar ao menu principal (0)\n";
                                                                                                                                                               cin>> res;
                                                                                                                                                               if (res == 1){
                                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                                               system("pause");
                                                                                                                                                               }
                                                                                                                                                               else{
                                                                                                                                                               goto inicio;
                                                                                                                                                               system("pause");
                                                                                                                                                               }

                                                                                                                 }
                                                                                                                 }
                                                                                                                 }
                                                                                                 }
                                                 }
                                                 }
                                                 break;
                                                
                                                 case 4:
                                                                 teste3:
                                                                 Valor = 37677.00;
              marca = "Polo GT 2.0";
              cout << "O automovel escolhido foi "<<marca<<"\n";
              cout << " este e o valor do seu automovel R$ "<< Valor<<"\n";
              cout<< "\n deseja inserir opcionais neste modelo de carro (Sim (1) / Não (0))?";
              cin>> res;
                                                 if (res == 1){
                           cout<< "\nSelecione os opcionais desejados: \n";
                           cout<< "\n 1- Trio Eletrico (Alarme, Vidro e Trava eletrica) R$ 250,00";
                           cout<< "\n 2- Ar-Condicionado R$ 950,00" ;
                           cout<< "\n 3- Direcao hidraulica R$ 385,00";
                           cout<< "\n 4- Completo (itens 1,2 e 3 juntos) R$";
                           cout<< "\n 0- nenhum adicional";
                           cout<< "\nNa compra do modelo completo ganhará um grande desconto\n";
                           cout<< "So pagará acrescimo de 3,5% do valor total com adicional e IPI incluso\n";
                                                                                                 cin>> opcao;
                                                                                                 switch (opcao)
                                                                                                 {
                                                                                                 case 0: cout<< "\nVoce nao selecionou nenhum opcional";
                                  cout<< "\ndeseja finalizar sua compra ? (Sim (1) / Não (0))\n";
                                  cin>> res;
                                                                                                                               if (res == 1){
                                                                                                                               contador = 0;
                                  taxa = Valor * IPI;
                                  total = Valor + taxa;
                                  cout<<"\nValor do seu automovel é R$ "<<Valor;
                                  cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                  cout<<"\nValor total a ser pago é de R$"<<total;
                                  cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                               system("pause");
                                                                                                                               }
                                                                                                                               else{
                                                                                                                               goto inicio;
                                                                                                                               }
                                                                                                                               break;
                                                                                                 case 1:
                                                                                                                 cout<< "\nVoce selecionou o Trio eletrico (alarme, trava, vidro eletrico) R$ 250.00";
                                                                                                                 contador = 1;
                               Valor = Valor + 250.00;
                               taxa = Valor * IPI;
                               total = Valor + taxa;
                               cout<<"\nValor do seu automovel é R$ "<<Valor;
                               cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                               cout<<"\nValor total a ser pago é de R$ "<<total;
                               cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                               cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                               cin>> res;
                                                                                                                 if (res == 1){
                                                                                                                 cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                 system("pause");
                                                                                                                 }
                                                                                                                 else{
                                                                                                                 cout<<"Voce ja selecionou o trio eletrico, selecione outro opcional";
                               cout<< "\n 2- Ar-Condicionado R$ 950,00" ;
                               cout<< "\n 3- Direcao hidraulica R$ 385,00";
                               cin>> opcao;
                                                                                                                 switch (opcao){
                                                                                                                                             case 2:
                                      cout<< "\nVoce selecionou o Ar-condicionado R$ 950.00";
                                      contador = 2;
                                      Valor = Valor + 950.00;
                                      taxa = Valor * IPI;
                                      total = Valor + taxa;
                                      cout<<"\nValor do seu automovel é R$ "<<Valor;
                                      cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                      cout<<"\nValor total a ser pago é de R$ "<<total;
                                      cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                                      cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                                                                                                                                               cin>> res;
                                                                                                                                               if (res == 1){
                                      
                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                               system("pause");
                                                                                                                                               }
                                                                                                                                               else{
                                                                                                                                              
                                      cout<<"\nVoce ja selecionou o trio eletrico, selecione outro opcional";
                                      cout<< "\nVoce ja selecionou o ar-condicionado, selecione outro opcional";
                                      cout<< "\n 3- Direcao hidraulica R$ 385,00";
                                                                                                                                               cin>> opcao;
                                                                                                                                               switch (opcao){
                                                                                                                                                                            case 3:
                                                                                                                                                               cout<< "\nVoce selecionou a direcao hidraulica R$ 385.00";
                                          contador = 3;
                                          Valor = Valor + 385.00;
                                          taxa = Valor * IPI;
                                          total = Valor + taxa;
                                          cout<<"\nValor do seu automovel é R$ "<<Valor;
                                          cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                          cout<<"\nValor total a ser pago é de R$ "<<total;
                                          cout<<"\ndeseja finalizar a compra ou Voltar ao menu principal ?";
                                          cout<<"\nFinalizar compra (1) - Voltar ao menu principal (0)\n";
                                                                                                                                                               cin>> res;
                                                                                                                                                               if (res == 1){
                                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                                               system("pause");
                                                                                                                                                               }
                                                                                                                                                               else{
                                                                                                                                                               goto inicio;
                                                                                                                                                               }
                                                                                                                                               }
                                                                                                                                               }
                                                                                                                 break;
                                                                                                                 case 3:
                                                                                                                                cout<< "\nVoce selecionou a direcao hidraulica R$ 385.00";
                                      contador = 2;
                                      Valor = Valor + 385.00;
                                      taxa = Valor * IPI;
                                      total = Valor + taxa;
                                      cout<<"\nValor do seu automovel é R$ "<<Valor;
                                      cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                      cout<<"\nValor total a ser pago é de R$ "<<total;
                                      cout<<"\ndeseja finalizar a compra ou adicionar outro opcional ?";
                                      cout<<"\nFinalizar compra (1) - adicionar outro opcional (0)\n";
                                      cin>> res;
                                                                                                                                               if (res == 1){
                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                               system("pause");
                                                                                                                                               }
                                                                                                                                               else{
                                                                                                                                              
                                      cout<<"\nVoce ja selecionou o trio eletrico, selecione outro opcional";
                                      cout<< "\n 2 - Ar-condicionado R$ 950,00";
                                      cout<< "\n Voce ja selecionou a direcao hidraulica";
                                                                                                                                               cin>> opcao;
                                                                                                                                               switch (opcao){
                                                                                                                                               case 3:
                                                                                                                                                               cout<< "\nVoce selecionou o Ar-condicionado R$ 950.00";
                                          contador = 3;
                                          Valor = Valor + 950.00;
                                          taxa = Valor * IPI;
                                          total = Valor + taxa;
                                          cout<<"\nValor do seu automovel é R$ "<<Valor;
                                          cout<<"\nValor do IPI equivalente a 8% é R$ "<<taxa;
                                          cout<<"\nValor total a ser pago é de R$ "<<total;
                                          cout<<"\ndeseja finalizar a compra ou Voltar ao menu principal ?";
                                          cout<<"\nFinalizar compra (1) - Voltar ao menu principal (0)\n";
                                                                                                                                                               cin>> res;
                                                                                                                                                               if (res == 1){
                                                                                                                                                               cout<<"\nQuantidade de Opcional selecionado "<< contador<<"\n";
                                                                                                                                                               system("pause");
                                                                                                                                                               }
                                                                                                                                                               else{
                                                                                                                                                               goto inicio;
                                                                                                                                                               system("pause");
                                                                                                                                                               }

                                                                                                                 }
                                                                                                                 }
                                                                                                                 }
                                                                                                 }
                                                 }
                                                 }
                                                 break;
                                                 default: cout<< "\n Numero Invalido.\n";
                                                                 goto inicio;
                }
}
}

}

faço trabalhos avulsos de programação em php , javascript , html , VBA-EXCEL e EXCEL formulas avançadas . pode entrar em contato no whatsapp 83988596239. nós combinaremos os valores de acordo com a demanda.

Nenhum comentário:

Postar um comentário

Programando com JS 2 / 5 - Resto 2

  Desafio Leia um valor inteiro N . Apresente todos os números entre 1 e 10000 que divididos por N dão resto igual a 2. Entrada A ...