Hi guys,
I need some help with this code, I just can't get it to run.
Thanks!
import java.util.Scanner; public class Invest{ public static void main(String[] args){ Scanner reader = new Scanner(System.in); double principal = 0; double rate = 0; int years = 0; double total = 0; System.out.println ("Enter your initial investment amount: "); principal = reader.nextInt(); System.out.println ("Enter the number of years: "); rate = reader.nextInt(); System.out.println ("Enter the interst rate: "); rate = reader.nextInt(); total= (rate*years)*principal; { //System.out.println(" years"); } System.out.print("your total investment is:" + total); } }