+ 2
Help me in question 20 in Java section
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
+ 2
Attempts?
+ 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...
+ 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.
+ 1
Yes
+ 1
Thanks
+ 1
Thanks
0
Ok
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
0
Can you explain array
0
I don't understand