Advertisement
almmiron

15:30

Aug 23rd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.     public class Opcoes
  10.     {
  11.         int opescolhida, isPref, qtdSenhaNormal, queuePosition, qtdSenhaPreferencial;
  12.         string nome, conta;
  13.         int[] fila = new int[15] { 1, 2, 3, 4, 5,6,7,8,9,10,11,12,13,14,15};
  14.         string[] clientesNaFila = new string[15];
  15.          
  16.  
  17.         public void chamarmenuprincipal()
  18.         {
  19.            
  20.             while (opescolhida !=5)
  21.             {
  22.  
  23.             Console.WriteLine("Senhas Normais: " + qtdSenhaNormal + ".\n Senhas Preferenciais: " + qtdSenhaPreferencial + "\n");
  24.             for (fila[i] == fila[1]; fila  15;  sclientesNaFila++) {
  25.  
  26.                     Console.WriteLine("Posição: " + fila + ". " + clientesNafila + "\n");
  27.                         }
  28.  
  29.                 Console.Write("\nDigite o número correspondente para opção desejada!\n");
  30.             Console.WriteLine("\n1 - Cadastrar Cliente");
  31.             Console.WriteLine("2 - Gerar Senha ");
  32.             Console.WriteLine("3 - Gerar Senha Preferencial");
  33.             Console.WriteLine("4 - Alterar Cadastro de Cliente");
  34.             Console.WriteLine("5 - Sair do Sistema\n");
  35.             opescolhida = int.Parse(Console.ReadLine());
  36.             switch (opescolhida)
  37.             {
  38.                 //SE 1: realizar cadastro--------------------------------------------pronto
  39.                 case 1:
  40.                     Console.WriteLine("\nDigite o Nome do Cliente\n");
  41.                     nome = Console.ReadLine();
  42.                     Console.WriteLine("\nDigite a Conta do cliente\n");
  43.                     conta = Console.ReadLine();
  44.                     Console.WriteLine("\nDigite 0 para senha normal, ou 1 para senha preferencial\n");
  45.                     isPref = int.Parse(Console.ReadLine());
  46.                     if (isPref == 1)
  47.                         {
  48.                             qtdSenhaPreferencial = qtdSenhaPreferencial + 1;
  49.  
  50.                         }else if (isPref == 0)
  51.                             {
  52.  
  53.                             qtdSenhaNormal = qtdSenhaNormal + 1;
  54.                             }else
  55.                                 {
  56.                                     Console.WriteLine("Error Machine");
  57.                                     Console.Clear();
  58.                                     chamarmenuprincipal();
  59.                                 }
  60.  
  61.                         Console.Clear();
  62.  
  63.                     break;
  64.  
  65.                 //SE 2: gerar a senha------------------------------
  66.                 case 2:
  67.                         qtdSenhaNormal = qtdSenhaNormal + 1;
  68.  
  69.                         Console.Clear();
  70.                         break;
  71.  
  72.                 //SE 3: gerar senha preferencial-------------------
  73.                 case 3:
  74.  
  75.                         qtdSenhaPreferencial = qtdSenhaPreferencial + 1;
  76.  
  77.                         Console.Clear();
  78.                         break;
  79.  
  80.                 //SE 4:  alterar cadastro----------------------------pronto
  81.                 case 4:
  82.  
  83.                     Console.WriteLine("\nDigite o Nome atualizado do Cliente\n");
  84.                     nome = Console.ReadLine();
  85.                     Console.WriteLine("\nDigite a Conta atualizada do Cliente\n");
  86.                     conta = Console.ReadLine();
  87.                     break;
  88.  
  89.  
  90.  
  91.                 //SE 5:visualizar a variavel nome e conta----------------------------pronto
  92.                 case 5:
  93.  
  94.                     Environment.Exit(0);
  95.                     break;
  96.  
  97.                 //SE 6:fechar a janela-----------------------------------------------pronto
  98.                 case 6:
  99.  
  100.  
  101.  
  102.                 //SE DIGITAR ERRADO:-------------------------------------------------pronto
  103.                 default:
  104.                     Console.Write("\nOpção inválida. Aperte qualquer tecla para sair...\n");
  105.                     Console.ReadKey();
  106.  
  107.                     break;
  108.             }//------------------------------------------------------------------------------------------------------------
  109.             }
  110.         }
  111.  
  112.  
  113.  
  114.     }
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement