Skip to content

Commit d9ab3a7

Browse files
authored
Add files via upload
1 parent 4d8b0be commit d9ab3a7

File tree

3 files changed

+96
-0
lines changed

3 files changed

+96
-0
lines changed

codingfarmacia/codingfarmacia.iml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>
Binary file not shown.

codingfarmacia/src/Main.java

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import com.sun.security.jgss.GSSUtil;
2+
3+
import java.sql.SQLOutput;
4+
import java.util.Scanner;
5+
6+
// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
7+
// then press Enter. You can now see whitespace characters in your code.
8+
import java.util.Scanner;
9+
10+
11+
12+
public class Main {
13+
14+
public static void main(String[] args) {
15+
16+
17+
Scanner s = new Scanner(System.in);
18+
Scanner scanner = new Scanner(System.in);
19+
String usuarioCorreto = "admin";
20+
String senhaCorreta = "admin";
21+
22+
23+
boolean loginBemSucedido = false;
24+
System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@\n# #\n# FARMÁCIA GUADALAJARA #\n# #\n@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
25+
System.out.println("Faça login para continuar\n");
26+
while (! loginBemSucedido) {
27+
System.out.println("Digite o usuário:");
28+
String usuario = s.nextLine();
29+
30+
System.out.println("Digite sua senha:");
31+
String senha = s.nextLine();
32+
33+
if (usuario.equals(usuarioCorreto) && senha.equals(senhaCorreta)) {
34+
System.out.println("Usuário logado com sucesso!\n");
35+
loginBemSucedido = true;
36+
37+
} else {
38+
System.out.println("Nome de usuário ou senha incorretos. Tente novamente!\n");
39+
}
40+
}
41+
42+
int opcao = 0;
43+
System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@\n# #\n# SISTEMA FARMACEUTICO #\n# #\n@@@@@@@@@@@@@@@@@@@@@@@@@@@\n");
44+
45+
while (opcao != 9) {
46+
//System.out.println("\nCADASTRO DE MEDICAMENTO\n");
47+
48+
System.out.println("Digite a sua opção:");
49+
System.out.println("1 - Cadastrar Medicamento");
50+
System.out.println("2 - Consultar Medicamento");
51+
System.out.println("3 - Alterar Cadastro");
52+
System.out.println("4 - Remover Cadastro");
53+
System.out.println("5 - Exibir todos os cadastros");
54+
System.out.println("9 - Sair do sistema");
55+
System.out.print("Sua opção: ");
56+
opcao = s.nextInt();
57+
58+
switch (opcao) {
59+
case 1: // cadastrar conta
60+
System.out.println("Você escolheu cadastrar um Medicamento");
61+
62+
break;
63+
case 2: // consultar conta
64+
System.out.println("Você escolheu consultar um Medicamento");
65+
break;
66+
case 3: // alterar conta
67+
System.out.println("Você escolheu alterar um Cadastro");
68+
break;
69+
case 4: // remover conta
70+
System.out.println("Você escolheu remover um Cadastro");
71+
break;
72+
case 5: // exibe todas as contas
73+
System.out.println("Você escolheu exibir todos os Cadastros");
74+
break;
75+
}
76+
try { Thread.sleep(4000); }
77+
78+
79+
catch(Exception e) { e.printStackTrace(); }
80+
}
81+
// encerramento do programa...
82+
System.out.println("Saindo do sistema");
83+
}
84+
85+
}

0 commit comments

Comments
 (0)