Creating Loops | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Creating Loops

Need Help With this Project: You take a loan from a friend and need to calculate how much you will owe him after 3 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 outputs the remaining amount after 3 months.

22nd Aug 2022, 12:02 PM
Onica Victory
4 Answers
+ 7
Onica Victory , there is no hint about the programming language you are going to use. please update your post by putting the required information in a tag.
22nd Aug 2022, 2:23 PM
Lothar
Lothar - avatar
+ 3
Hi! Please, show us your try.
22nd Aug 2022, 12:25 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
Lothar this is task "credit calculator" 19 lesson course of Java
22nd Aug 2022, 5:35 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
This is in java. I keep on getting an error for my multiplication attempt, but I'm not sure why import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amount = scanner.nextInt(); int month = 1; double interest = 0.10; int payment = interest * amount; int owe = amount = payment; while (3 <= month) {owe = amount - payment; month++; } System.out.println(payment); } }.
5th Sep 2022, 6:30 AM
Onica Victory