Answer:
if you give me brainliest i will answer your question
Explan
Answer:
Written in Python
import math
principal = 8000
rate = 0.025
for i in range(1, 11):
amount = principal + principal * rate
principal = amount
print("Year "+str(i)+": "+str(round(amount,2)))
Explanation:
This line imports math library
import math
This line initializes principal amount to 8000
principal = 8000
This line initializes rate to 0.025
rate = 0.025
The following is an iteration from year 1 to 10
for i in range(1, 11):
This calculates the amount at the end of the year
amount = principal + principal * rate
This calculates the amount at the beginning of the next year
principal = amount
This prints the calculated amount
print("Year "+str(i)+": "+str(round(amount,2)))
This statement checks if num1 is equal to the absolute value of num1
For instance,
num1 = 4 and the absolute value of num1 = 4. This would run the code inside the if statement but if num1 = -1 the absolute value of num1 = 1 and the if stamtent would be skipped because -1 does not equal 1