A group of students is arguing about which are better terms for a loan with compound interest—longer time with lower interest, or shorter time with higher interest. They decide to write a program to calculate each total so that they can compare between both the conditions: principal = 10000 rate = 10.25 time = 5 Amount = principal * (pow((1 + rate / 100), time)) Total = Amount + principal print("Compound interest is", Amount + principal) rate = 5.25 time = 10 Amount = principal * (pow((1 + rate / 100), time)) print("Compound interest is", Amount + principal) Which code should be placed into a function? (1 point) Responses print("Compound interest is", Amount + principal) print("Compound interest is", Amount + principal) Amount = principal * (pow((1 + rate / 100), time)) Amount = principal * (pow((1 + rate / 100), time)) rate = 10.25 rate = 10.25 principal = 10000
3 answers
```python
def calculate_compound_interest():
principal = 10000
rate = 10.25
time = 5
Amount = principal * (pow((1 + rate / 100), time))
Total = Amount + principal
print("Compound interest is", Total)
rate = 5.25
time = 10
Amount = principal * (pow((1 + rate / 100), time))
Total = Amount + principal
print("Compound interest is", Total)
```
This function calculates and prints the compound interest for two scenarios: one with a principal of $10,000, a rate of 10.25% and a time of 5 years; and another with a principal of $10,000, a rate of 5.25% and a time of 10 years.
sequential-driven programming – an application that displays all the letters for kids to learn