Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ex15;
- import java.util.Scanner;
- public class ex15 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int tipoinv;
- double poupança, rendafixa, investimento;
- System.out.println("Digite o tipo de investimento"+"\n"+"Sendo 1 para poupança e 2 para renda fixa.");
- tipoinv = sc.nextInt();
- System.out.println("Digite o valor de investimento");
- investimento = sc.nextDouble();
- if (tipoinv == 1)
- {
- poupança = investimento * 1.03;
- System.out.println("O valor investido na poupança será de: "+poupança);
- }
- if (tipoinv == 2)
- {
- rendafixa = investimento * 1.04;
- System.out.println("O valor investido na renda fixa será de: "+rendafixa);
- }
- }
- }
- /* receber tipo de investimento
- receber valor
- calcular valor * %
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement