Help!!! Java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Help!!! Java

i need help with java exercise, loan calculator

6th Feb 2021, 5:05 AM
xnaider mestra
xnaider mestra - avatar
7 Answers
+ 2
No I am asking you to show your code which you tried
6th Feb 2021, 5:34 AM
Atul [Inactive]
+ 1
Please post what you have tried
6th Feb 2021, 5:15 AM
Atul [Inactive]
+ 1
double amount = scanner.nextInt(); for (int x=1; x<=6; x++) { amount -= (Math.ceil(amount/10)); } System.out.println((int)amount); } } These are some necessary changes that you should bring in your code
6th Feb 2021, 6:22 AM
Atul [Inactive]
0
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); //tu código va aquí for (int x=1; x<=6; x++) { amount= amount * 10 / 100; System.out.println(amount); } } }
6th Feb 2021, 5:53 AM
xnaider mestra
xnaider mestra - avatar
0
thank’s
6th Feb 2021, 7:50 PM
xnaider mestra
xnaider mestra - avatar
0
In this exercise, instead of working with int, it's better to work with double or float
6th Feb 2021, 8:12 PM
Sattar
Sattar - avatar
- 1
You ask a friend for a loan and need to calculate how much you will owe him after 6 months. You are going to pay him back 10% of the remaining loan amount each month. Create a program that takes the loan amount as input, calculates and generates the remaining amount after 6 months. Input example: 20000 Output example: 10628 Here is the monthly payment schedule: Month 1 Payout: 10% of 20000 = 2000 Quantity Remaining: 18000 Month 2 Payment: 10% of 18000 = 1800 Quantity Remaining: 16200 Month 3: Payout: 10% of 16200 = 1620 Quantity Remaining: 14580 Month 4: Payout: 10% of 14580 = 1458 Quantity Remaining: 13122 Month 5: Payment: 10% of 13122 = 1313 Quantity Remaining: 11809 Month 6: Payment: 10% of 11809 = 1181 Amount Remaining: 10628 Use a loop to calculate your payment and the amounts remaining for each month. Also, use whole numbers for quantities.
6th Feb 2021, 5:30 AM
xnaider mestra
xnaider mestra - avatar