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
import java.util.Scanner; | |
public class OlaMundo{ | |
public static void main (String [] args) | |
{ | |
Scanner sc = new Scanner (System.in); | |
System.out.println ("Digite um numero que voce deseja somar"); | |
int x = sc.nextInt(); | |
System.out.println ("Digite outro numero que voce deseja somar"); | |
int y = sc.nextInt(); | |
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
/* | |
A partir da quantidade de homens e de mulheres de uma sala de SI digitada pelo usuário, calcule o percentual (separadamente) de homens e mulheres desta turma. | |
*/ | |
import java.util.Scanner; | |
class Problema1 { | |
public static void main (String [] args) { | |
System.out.println("digite o numero de homens"); | |
Scanner sc=new Scanner(System.in); |
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
/* | |
A partir de 3 notas fornecidas de um aluno, informe se ele foi aprovado, ficou de recuperação ou foi reprovado. | |
A média de aprovação é >= 5.0; a média de recuperação é >= 3.0 e < 5.0; e a média do reprovado é < 3.0 | |
*/ | |
import java.util.Scanner; | |
class Problema2 { | |
public static void main (String[] args){ | |
Scanner sc = new Scanner(System.in); | |
System.out.println("Digite a primeira nota:"); | |
double nota1 = sc.nextDouble(); |
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
/* | |
-Receba o ano de nascimento de dois usuários e o ano atual | |
-Exiba: | |
-A idade dos usuários | |
-O usuário mais velho | |
-A diferença de idade entre os usuários | |
*/ | |
import java.util.Scanner; |
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
/* | |
Escreva um programa que, a partir dos coefientes de uma equação do segundo grau, calcule suas raízes, escrevendo a resposta na tela. | |
*/ | |
import java.lang.Math; | |
import java.util.Scanner; | |
class Problema4{ | |
public static void main (String args []){ | |
Scanner sc=new Scanner(System.in); | |
System.out.println("Digite os termos a,b e c de uma equação de segundo grau: "); |
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
import java.util.Scanner; | |
class Jokenpo { | |
public static void main (String args []){ | |
Scanner sc = new Scanner(System.in); | |
int v1,v2; | |
System.out.println("Escolha entre 0, 1 e 2 , sendo : "); | |
System.out.println("Pedra = 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
import java.util.Scanner; | |
class Meses { | |
public static void main (String[] args){ | |
Scanner sc = new Scanner (System.in); | |
System.out.println ("Digite um numero"); | |
int mes = sc.nextInt (); | |
switch (mes) { | |
case 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
/* | |
*Dado o tempo em horas, minutos e segundos, imprimir esse tempo em segundos. | |
*/ | |
import java.util.Scanner; | |
class Tempo | |
{ | |
public static void main (String [] args) | |
{ |
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
/* | |
Neste problema, você deverá exibir uma lista de 1 a 100, um em cada linha, com as seguintes exceções: | |
- Números divisíveis por 3 deve aparecer como 'Fizz' ao invés do número; | |
- Números divisíveis por 5 devem aparecer como 'Buzz' ao invés do número; | |
- Números divisíveis por 3 e 5 devem aparecer como 'FizzBuzz' ao invés do número'. | |
*/ | |
class Numeros { | |
public static void main (String [] args) { | |
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
/* | |
Desenvolva um programa que simule a entrega de notas quando um cliente efetuar um saque em um caixa eletrônico. Os requisitos básicos são os seguintes: | |
- Entregar o menor número de notas; | |
- Notas disponíveis de R$ 100,00; R$ 50,00; R$ 20,00 e R$ 10,00 | |
Exemplo: | |
Valor do Saque: R$ 30,00 | |
Resultado Esperado: 1 nota de R$20,00 e 1 nota de R$ 10,00. | |
*/ | |
import java.util.Scanner; |
OlderNewer