This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n=int(input("Digite um numero:")) | |
x = 1 | |
serie=3 | |
soma = 0 | |
while x <= n: | |
valor = serie*x | |
print("serie: "+str(valor)) | |
soma += x/valor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n=int(input("Digite um numero:")) | |
soma=0 | |
for x in range(1, n+1): | |
if x%2!=0: | |
print(x**2) | |
soma+=x**2 | |
else: | |
soma+=x | |
print(x) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = int(input("Numero?")) | |
fat=1 | |
for x in range(1,n+1): | |
if(x%2!=0): | |
fat = fat*x | |
print(fat) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bo; | |
import dao.IAlunoDAO; | |
import exception.BOException; | |
import exception.DAOException; | |
public class AlunoBO { | |
IAlunoDAO alunoDAO; | |
public AlunoBO(IAlunoDAO alunoDAO) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bo; | |
import javax.swing.JOptionPane; | |
public class Conta { | |
private double saldo; | |
public void depositar(double valor) throws NumberFormatException, Exception { | |
if(valor > 0) | |
this.saldo += valor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CaixaEletronico { | |
public void emitirDinheiro(double valor) { | |
System.out.println("Retire o dinheiro: " + valor); | |
System.out.println("Saque efetuado com sucesso!"); | |
} | |
public static void main(String[] args) { | |
Conta conta = new Conta(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.Connection; | |
import java.sql.ResultSet; | |
import java.sql.PreparedStatement; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
public class LoginDAO implements ILoginDAO { | |
static Connection conexao; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.SQLException; | |
public class ConexaoMySQL implements IConexao { | |
private String usuario; | |
private String senha; | |
private static Connection conexao; |