0

Loan calculator project

Help me to fix and explain the problem, why my result is wrong https://code.sololearn.com/cZPyy5EABr4U/?ref=app

11th Feb 2021, 12:58 PM
Semmy Rajita
Semmy Rajita - avatar
4 odpowiedzi
+ 1
try this😁 for(int i=0;i<6;i++){ int payment =(int)(10*amount )/100; if((amount%10)!=0){ amount =amount-1; } amount = amount- payment ; } System .out .print(amount);
11th Feb 2021, 1:03 PM
Sebastian Utoiu
Sebastian Utoiu - avatar
+ 1
Thank you Sebastian Utoiu
11th Feb 2021, 1:47 PM
Semmy Rajita
Semmy Rajita - avatar
+ 1
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); //your code goes here int months = 3; for (int i = 0; i < months; i++) amount = amount * 90 / 100; System.out.println(amount); } }
21st Apr 2021, 2:18 AM
Jose Reinaldo Parra Morales
Jose Reinaldo Parra Morales - avatar
0
import java.util.Scanner ; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner (System.in); int amount = scanner.nextInt(); int aMonth; int toMonth = 3; for (aMonth = 1;aMonth <= toMonth;aMonth++){ amount = amount - (amount / 10); System.out.print("month: " + aMonth ); System.out.println("remain amount: " + amount); --amount; } } }
20th Dec 2022, 10:41 AM
Langaru Ravalika
Langaru Ravalika - avatar