This file contains 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
<?php | |
function DBconecta() { | |
if (!defined('HOST') && !defined('DB') && !defined('USER') && !defined('PASS')) { | |
die('Erro de conexão com banco de dados.'); | |
} | |
return mysqli_connect(HOST, USER, PASS, DB) or die(mysqli_connect_error($conexao)); | |
} |
This file contains 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
<?php | |
namespace App\Http\Controllers\Admin; | |
use App\Http\Controllers\Controller; | |
use App\Http\Requests\StoreUserRequest; | |
use App\User; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Auth; | |
use Illuminate\Support\Facades\Hash; |
This file contains 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
<?php | |
// Inclue no topo a conexão com o banco de dados | |
include 'conect_db.php'; | |
// Captura os valores do formulário | |
$conta = $_POST['conta']; | |
$nome = $_POST['nome']; | |
// Converte a variável para o formato de decimal do PHP e MySQL | |
// Ex. 4,50 para 4.50 (troca a virgula pelo ponto) | |
$saque = str_replace(',', '.', $_POST['saque']); | |
// String da instrução SQL |
This file contains 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
<?php | |
session_start(); | |
// Inserir valores | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
$_SESSION['teste'][] = $_POST['valor']; | |
} | |
// Apagar valores | |
if (isset($_GET['apagar'])) { | |
unset($_SESSION['teste'][(int)$_GET['apagar']]); |
This file contains 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 Exercicios; | |
import java.util.Scanner; | |
public class Exerc16 { | |
public static void main(String[] args) { | |
Scanner ler = new Scanner(System.in); | |
int ingressoVendidos = 120, ingressoQtdMaximo = 0; | |
double ingressoValor = 5, despesas = 200, lucro, lucroMaximo = 0, ingressoMaximo = 0; | |
This file contains 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 Exercicios; | |
import java.util.Scanner; | |
public class Exerc15 { | |
public static void main(String[] args) { | |
Scanner ler = new Scanner(System.in); | |
int n, positivos = 0, negativos = 0, cont; | |
for (cont = 0; cont < 20; cont++) { | |
System.out.printf("Digite o %02dº número: ", cont + 1); |
This file contains 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 Exercicios; | |
import java.util.Scanner; | |
public class Exerc13 { | |
public static void main(String[] args) { | |
Scanner ler = new Scanner(System.in); | |
int idade, mais90 = 0, cont; | |
double peso, mediaIdade = 0; | |
This file contains 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 Exercicios; | |
import java.util.Scanner; | |
public class Exerc12 { | |
public static void main(String[] args) { | |
Scanner ler = new Scanner(System.in); | |
int n, cont; | |
System.out.print("Digite um número: "); |
This file contains 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 Exercicios; | |
import java.util.Scanner; | |
public class Exerc11 { | |
public static void main(String[] args) { | |
Scanner ler = new Scanner(System.in); | |
int idade, maior = 0, cont; | |
for(cont = 0; cont < 10; cont++) { |
This file contains 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 Exercicios; | |
import java.util.Scanner; | |
public class Exerc10 { | |
public static void main(String[] args) { | |
Scanner ler = new Scanner(System.in); | |
double nt1, nt2, nt3, media; | |
do { |
NewerOlder