Advertisement
cesarnascimento

ex15 cap4

Mar 28th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. package ex15;
  2. import java.util.Scanner;
  3. public class ex15 {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         int tipoinv;
  8.         double poupança, rendafixa, investimento;
  9.         System.out.println("Digite o tipo de investimento"+"\n"+"Sendo 1 para poupança e 2 para renda fixa.");
  10.         tipoinv = sc.nextInt();
  11.         System.out.println("Digite o valor de investimento");
  12.         investimento = sc.nextDouble();
  13.         if (tipoinv == 1)
  14.         {
  15.         poupança = investimento * 1.03;
  16.         System.out.println("O valor investido na poupança será de: "+poupança); 
  17.         }
  18.         if (tipoinv == 2)
  19.         {  
  20.         rendafixa = investimento * 1.04;
  21.         System.out.println("O valor investido na renda fixa será de: "+rendafixa);
  22.         }
  23.     }
  24.  
  25. }
  26.  
  27. /* receber tipo de investimento
  28. receber valor
  29. calcular valor * %
  30. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement