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
/* | |
* Faça um algoritmo que leia cinco pares de valores(a, b), todos inteiros e positivos, um de cada vez. | |
* Mostre os números inteiros pares entre a e b para cada par lido. | |
*/ | |
package lacosdowhile; | |
import java.util.Scanner; | |
public class Problema03A { |
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
/* | |
* Faça um algoritmo que receba a idade, altura e peso de X pessoas. Calcule e mostre: | |
* - a quantidade de pessoas com idade superior a 50 anos; | |
* - a média das alturas das pessoas com idade entre 10 e 20 anos; | |
* - a percentagem de pessoas com peso inferior a 40 quilos entre todas as pessoas analisadas. | |
*/ | |
package lacosdowhile; | |
import java.util.Scanner; |
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
/* Um funcionário de uma empresa recebe aumento salarial anualmente. Sabe-se que: | |
* Ele foi contratado em 2005, com salario inicial de 1000 | |
* Em 2006, ele recebeu auento de 1.5% sobre seu salario inicial | |
* A partir de 2007, os aumentos salariais sempre corresponderam ao dobro do percentual do ano anterior | |
* Faça um algoritmo que determine o salário atual (2012) desse funcionário. | |
*/ | |
package lacosdowhile; | |
import java.util.Scanner; |
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
/* | |
* Faça um algoritmo que receba vários números positivos e que calcule e mostre: | |
* a soma dos números digitados | |
* a quantidade de números digitados | |
* a média dos números digitados | |
*/ | |
package lacosdowhile; | |
import java.util.Scanner; |
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
/* Construir um algoritmo para imprimir a série de FIBONACCI até o 10º termo. | |
* A série de FIBONACCI é formada pela sequência: | |
*0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55... | |
*/ | |
package cap14; | |
public class Exercicio02 { | |
public static void main(String[] args){ | |
int num1 = 1, num2 = 0; |
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
/* só pode ser utilizada com os seguintes tipos: | |
* byte, short, char, int e String. | |
* Ótima opção para fazer Menus. | |
*/ | |
package condicional; | |
import java.util.Scanner; | |
public class Switch { | |
public static void main(String[] args){ |
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
/* | |
* Faça um programa que dê o conteito do aluno conforme sua nota média. | |
* | |
* Entrada: 3 notas | |
* Saída: média das notas e o conceito | |
* | |
* caso 0 <= média < 4 -> Nota E | |
* caso 4 <= média < 5 -> Nota D | |
* caso 5 <= média < 7 -> Nota C | |
* caso 7 <= média < 8 -> Nota B |
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
/* | |
* Faça um programa que calcule o fatorial de um número inteiro. | |
* Repita a operação de cálculo X vezes. | |
*/ | |
package cap14; | |
import java.util.Scanner; | |
public class Exercicio03 { |
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
/* | |
* Faça um programa de cálculo de potência que solicite dois números (n e m) | |
* e faça o cálculo de n^m. Repita esse cálculo até o usuário digitar n = 0. | |
*/ | |
package cap14; | |
import java.util.Scanner; | |
public class Exercicio04 { | |
public static void main(String[] args){ |
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
/* | |
* Faça um programa que informe se um dado ano é bissexto ou não. | |
* Repira essa operação 15 vezes. | |
* | |
* Obs: um ano é bissexto se ele for divisível por 400 ou se ele for divisível por 4 e não por 100. | |
*/ | |
package cap14; | |
import java.util.Scanner; |
OlderNewer