Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void menuVisualizar(char produtoBase)
  5. {
  6. printf("==============================================\n");
  7. printf("TODOS OS PRODUTOS BASE DISPONÍVEIS NO ESTOQUE\n");
  8. for(int i = 0; i>=0; i++)
  9. printf("==============================================\n");
  10. }
  11.  
  12.  
  13. int main()
  14. {
  15. int inf = 1;
  16. char respMenuPrinc, respSair;
  17. char produtoBase[55];
  18.  
  19. produtoBase[0] = "Farinha";
  20. produtoBase[1] = "Ovo";
  21.  
  22.  
  23. while (inf == 1)
  24. {
  25. printf("===============================\n");
  26. printf("\tMenu Principal\t\n");
  27. printf("1. Visualizar\n");
  28. printf("2. Adicionar\n");
  29. printf("3. Remover\n");
  30. printf("4. Pesquisar\n");
  31. printf("5. Sair\n");
  32. printf("===============================\n");
  33.  
  34. respMenuPrinc = getche();
  35. printf("\n");
  36. switch(respMenuPrinc)
  37. {
  38. case '1':
  39. menuVisualizar(produtoBase);
  40. break;
  41.  
  42. case '2':
  43. //MenuAdicionar();
  44. break;
  45.  
  46. case '3':
  47. //MenuRemover();
  48. break;
  49.  
  50. case '4':
  51. //MenuPesquisar();
  52. break;
  53.  
  54. case '5':
  55. printf("SAIR\n");
  56. printf("Voce tem certeza? (Y/N)\n");
  57. respSair = getche();
  58. printf("\n");
  59. switch (respSair)
  60. {
  61. case 'y':
  62. inf = 0;
  63. break;
  64.  
  65. case 'Y':
  66. inf = 0;
  67. break;
  68.  
  69. case 'n':
  70. inf = 1;
  71. system("cls");
  72. break;
  73.  
  74. case 'N':
  75. inf = 1;
  76. system("cls");
  77. break;
  78.  
  79. default:
  80. inf = 1;
  81. system("cls");
  82. }
  83. break; //Sai do loop
  84.  
  85. default:
  86. system("cls");
  87. printf("Escolha uma das opcoes!\n\n");
  88. }
  89. }
  90. printf("Aperte qualquer tecla para continuar...\n");
  91. getch();
  92. return 0;
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement