Loan calculator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

Loan calculator

How I can calculate loan code?

6th Apr 2021, 2:40 AM
Deem 23
Deem 23 - avatar
4 Answers
+ 15
First you can declare amount as an input variable. Then, you need to calculate 10% of the current amount and subtract that 10% from the current amount by running a loop for 3 times. Finally, you can get output outside loop. By the way, I gave some hints. Try to finish it yourself. Show your try if you can't solve it anymore.
6th Apr 2021, 3:10 AM
Simba
Simba - 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); } }
20th Dec 2022, 10:57 AM
Langaru Ravalika
Langaru Ravalika - avatar
- 5
0
22nd Jun 2021, 10:17 PM
n_p gaming
n_p gaming - avatar
- 5
I need help on how to code a simple calculator
17th Jul 2021, 3:18 PM
chuks
chuks - avatar