Answer:
The program is as follows:
def calctuit(pay,n,yrs):
if n == 0:
return
pay*=(1.025)
print("Year ",yrs,": ",pay)
calctuit(pay,n-1,yrs+1)
n = int(input("Years: "))
pay = float(input("Tuition: "))
yrs = 1
calctuit(pay,n,yrs)
Explanation:
The function begins here
def calctuit(pay,n,yrs):
This represents the base case
<em> if n == 0:</em>
<em> return</em>
This calculates the tuition for each year
pay*=(1.025)
This prints the tuition
print("Year ",yrs,": ",pay)
This calls the function again (i.e. recursively)
calctuit(pay,n-1,yrs+1)
The function ends here
This gets the number of years
n = int(input("Years: "))
This gets the tuition
pay = float(input("Tuition: "))
This initializes the years to 1
yrs = 1
This calls the function
calctuit(pay,n,yrs)
Answer:
The answer is improve the conditions of people in other countries
Answer:
#Set of three most popular names in 2007
male_names = {'Oliver', 'Declan', 'Henry'}
#The male_names set is displayed to the user
print(male_names)
#The name to be removed is accepted from the user as a string
remove_name = str(input("Enter name to remove: "))
#The name to be added is accepted from the user as a string
add_name = str(input("Enter name to add: "))
#The remove method of a set is use to remove the received remove_name
male_names.remove(remove_name)
#The add method of a set is use to add the received add_name
male_names.add(add_name)
#The new set of male_names is displayed to the user
print(male_names)
Explanation:
Merhaba
Bunu neden yapmak istersiniz?
:)
Answer:
length = float(input("Enter length of the backyard in foot: "))
width = float(input("Enter width of the backyard in foot: "))
sod_price = float(input("Enter the price of sod per square foot: "))
fencing_price = float(input("Enter the price of fencing per foot: "))
area = length * width
perimeter = 2 * (length + width)
cost = sod_price * area + fencing_price * perimeter
print("The cost of landscaping is $" + str(cost))
Explanation:
*The code is in Python.
Ask the user to enter the length, width, sod_price, and fencing_price
Calculate the area and perimeter of the backyard
Calculate the cost, sod_price * area + fencing_price * perimeter
Print the cost