Hey guys need some help on this program. I am simply trying to write a program that does the following....
There is an appliance store that is offering 1% (0.01) financing for 12 months on any purchase.
I need to use constants for the finance rate and number of months (which i think i got)
Have the user enter their purchase price
Formatting ALL numeric output with two decimals, tell the user how much their monthly payment
will be (using the formula below) and the total amount to be paid.
monthly payment = ( (purchase price* financing rate) + purchase price) / months
here is my code so far....
import java.util.Scanner;
public class rate
{
public static final int RATE = 0.01;
public static final int MONTH = 12;
public static void main(String[] args)
{
System.out.println(RATE);
System.out.println(MONTH);
Scanner s = new Scanner(System.in); // create a Scanner object
String input; // read in user input as a string
int qty; // number of items purchased
System.out.print("Price of purchased item: "); // user prompt
input = s.nextLine(); // read input as a string
purchase price = Integer.parseInt(input);
System.out.print("Your monthly payment: "); // user prompt
input = s.nextLine(); // read input as a string
financing rate = Integer.parseInt(input); // convert to int
System.out.println("Total purchase order = $" ( (purchase price* financing rate) + purchase price) / months);
} // end main
} // end class Lab1
It doesn't want to compile I get errors for having 0.01 and also i recieve numerous errors with
System.out.println("Total purchase order = $" ( (purchase price* financing rate) + purchase price) / months);
Any help is appreciated!
Have a nice day