Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lista2;
- import java.util.Scanner;
- public class atvtres {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- System.out.print("DIgite seu nome: ");
- String nome = scan.next();
- System.out.print("Digite sua idade: ");
- int idade = scan.nextInt();
- if (idade == 10) {
- System.out.println("Valor do plano fica R$ 30,00 "+nome);
- } else if (idade <= 29 ){
- System.out.println("Valor do plano fica R$ 60,00 "+nome);
- } else if (idade <= 45) {
- System.out.println("Valor do plano fica R$ 120,00 "+nome);
- } else if (idade <= 59) {
- System.out.println("Valor do plano fica R$ 150,00 "+nome);
- } else if (idade <= 65) {
- System.out.println("Valor do plano fica R$ 250,00 "+nome);
- } else if (idade >= 65) {
- System.out.println("Valor do plano fica R$ 400,00 "+ nome);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement