+ 2

Help me in question 20 in Java section

25th May 2022, 11:10 AM
Kavyansh Kedia
12 Antworten
+ 3
You are not updating amount after every iteration. Use amount = b; as a last statement in loop. And 10/100 result 0 as both are int values so 0*amount is 0 here instead, use amount*10/100
25th May 2022, 2:32 PM
Jayakrishna 🇮🇳
+ 2
Attempts?
25th May 2022, 11:12 AM
A͢J
A͢J - avatar
+ 2
You can tag the name of who you asking by type @ and select. Do you mean array in java? Better to use another thread for fresh question.. And mention some details what you don't understand with specifics.. It's a different topic and need more level discussion.. Simply an array in java is a similar collection of elements stored and retrieved under same name but different index values.. int arr[] = { 1,2,3,4,5 } ; is an array of integer values, length 5. Hope it helps...
25th May 2022, 3:34 PM
Jayakrishna 🇮🇳
+ 1
Can you post the question and copy your code into the code playground and attach it here? Otherwise, it's very difficult to help.
25th May 2022, 1:52 PM
Ausgrindtube
Ausgrindtube - avatar
+ 1
Yes
25th May 2022, 2:12 PM
Kavyansh Kedia
25th May 2022, 2:15 PM
Kavyansh Kedia
+ 1
Thanks
25th May 2022, 3:00 PM
Kavyansh Kedia
+ 1
Thanks
25th May 2022, 3:44 PM
Kavyansh Kedia
0
Ok
25th May 2022, 2:12 PM
Kavyansh Kedia
0
Question-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. Sample Input: 20000 Sample Output: 10628 Here is the monthly payment schedule: Month 1 Payment: 10% of 20000 = 2000 Remaining amount: 18000 Month 2 Payment: 10% of 18000 = 1800 Remaining amount: 16200 Month 3: Payment: 10% of 16200 = 1620 Remaining amount: 14580
25th May 2022, 2:15 PM
Kavyansh Kedia
0
Can you explain array
25th May 2022, 3:26 PM
Kavyansh Kedia
0
I don't understand
25th May 2022, 3:26 PM
Kavyansh Kedia