Java

*Purpose:
Say that you owe the credit card company \$1000.00. The company charges you 1.5% per month on the unpaid balance.
You have decided to stop using the card and to pay off the debt by making a monthly
payment of N dollars a month. Write a program that asks for the monthy payment,
then writes out the balance and total payments so far for every succeeding month until the balance is zero or less.

Enter the monthly payment:
100
Month: 1 balance: 915.0 total payments: 100.0
Month: 2 balance: 828.725 total payments: 200.0
Month: 3 balance: 741.155875 total payments: 300.0
Month: 4 balance: 652.273213125 total payments: 400.0
Month: 5 balance: 562.057311321875 total payments: 500.0
Month: 6 balance: 470.4881709917031 total payments: 600.0
Month: 7 balance: 377.54549355657866 total payments: 700.0
Month: 8 balance: 283.20867595992735 total payments: 800.0
Month: 9 balance: 187.4568060993263 total payments: 900.0
Month: 10 balance: 90.26865819081618 total payments: 1000.0
Month: 11 balance: -8.377311936321576 total payments: 1100.0

For each month, calculate the interest due on the unpaid balance.
Then calculate the new balance by adding the interest and subtracting the payment.

*/

class Exercise1
{
public static void main (String[] args )
{

final double owed= 1000.0;
final double tax=0.015;
double previousBalance=0;
int months;

System.out.print( "Enter the monthly payment: " );
double balance =(owed-payment)+(tax*payment);
balance= previousBalance;

while (previousBalance<owed)
{
previousBalance =(previousBalance-payment)+(tax*previousBalance);
System.out.println("Balance: "+previousBalance+ "Total Payments: "+balance);

}

}
}

1. 👍
2. 👎
3. 👁
1. this is what i have so far..

class Exercise1
{
public static void main (String[] args )
{

final double owed= 1000.0;
final double tax=0.015;
double previousBalance=0;
int months;

System.out.print( "Enter the monthly payment: " );
double balance =(owed-payment)+(tax*payment);
balance= previousBalance;

while (previousBalance<owed)
{
previousBalance =(previousBalance-payment)+(tax*previousBalance);
System.out.println("Balance: "+previousBalance+ "Total Payments: "+balance);

}

}
}

1. 👍
2. 👎
2. Do you know what this program is called? (asking)

1. 👍
2. 👎
3. class Exercise1
public static void main (String[] args )
final double owed= 1000.0;
final double tax=0.015;
double previousBalance=0;
int months;
System.out.print( "Enter the monthly payment: " );
double balance =(owed-payment)+(tax*payment);
balance= previousBalance;
while (previousBalance<owed)
{
previousBalance=(previousBalance-payment)+(tax*previousBalance); System.out.println("Balance: "+previousBalance+ "Total Payments: "+balance);

1. 👍
2. 👎
4. while (previousBalance<owed)
{
previousBalance =(previousBalance-payment)+(tax*previousBalance);
System.out.println("Balance: "+previousBalance+ "Total Payments: "+balance);

if it bothers you so much don't answer STUDENT

1. 👍
2. 👎
5. previousBalance=(previousBalance-payment)+(tax*previousBalance);
System.out.println("Balance:"+previousBalance+ "Total Payments: "+balance);
if it bothers you so much don't answer STUDENT

1. 👍
2. 👎

Similar Questions

1. ART

Artists are driven to create art for many different reasons. What seems to be the purpose for this artistic creation? For an aesthetic purpose. (MY ANSWER) For an entertainment purpose. For a utilitarian purpose. This is the

2. English

Please help me check my answers. 1.What is the purpose of an introduction?(1 point) a.to tell a story related to the main topic of a text b.to state the goals and purpose of the text c.to summarize the ideas in a text d.to provide

3. English

What is the purpose of an introduction? (1 Point) A to summarize the ideas in a text*** B to provide evidence that supports the central argument of a text C to tell a story related to the main topic of a text D to state the goals

4. Language Arts 7 A

Question 1 What is the purpose of an introduction? to provide evidence that supports the central argument of a text to tell a story related to the main topic of a text to summarize the ideas in a text to state the goals and

1. History

Which accurately describes aspects of the trans-Saharan trade between Europe and Africa? the trans-Saharan trade included the trade of both gold and slaves along the Saharan desert of Africa the trans-Saharan trade included the

2. English

5. Thomas Jefferson and Thomas Paine shared a similar purpose for writing. What was their purpose? (2 points) to express and reflect to persuade to inform to invite There is more than one possible; all the possible responses can

3. English

What is the purpose of a topic sentence in a paragraph?(1 point) A.to describe the most important details that will be included in the paragraph B.to provide evidence for the ideas in the paragraph C.to explain where readers can

4. World history

Which accurately describes the East India Company and its purpose? A.The East India Company was chartered by royal decree, and its purpose was to promote trade with India and China and force the natives to learn English. B . The

1. Art

buildings were created for a utilitarian purpose. Which of the following changes would not be practical to enhance the purpose of the building. Adding additional windows to each apartment building. Attaching movie screens on the

2. Social Studies

How was the art of ancient Mesopotamia different from that of earlier cultures? A. It included monuments that glorified the gods and showed religion in society. B. It included pretend animals and showed human imagination. C.

3. AG

1. The framers included the supremacy clause in the constitution for the purpose of a. giving the federal government complete authority over all actions of state governments. ******* b. making the individual stte governments more

4. Art

1. (Has a picture: Starry Night by Edvard Munch Artists are driven to create art for many different reasons. What seems to be the purpose for this artistic creation? For an aesthetic purpose.**** For an entertainment purpose. For