For this assignment you are to implement a program that
performs the following tasks jupitor notebook python:
Part A:
Outputs your name
Outputs the assignment number
Prompts the user to input a real (floating point) number representing the radius of a circle
Outputs the area of the circle having the radius that was input in Task 3
Part B:
One acre of land is equivalent to 43,560 square feet. Write a program that asks the user to enter the total square feet in a tract of land and calculates the number of acres in the tract.
Part C:
A customer in a store is purchasing three items. Write a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 8 percent.
Part D:
Ask for total sales in dollars and the sales in dollars
of a particular item A in the inventory. Calculate the % of total
sales that sales of A contributed to.
Part E:
Ask for radius r and calculate the circumference of the circle.
Part F:
Ask for a number n. Calculate 1+2+3+4….+n.
Part G:
Ask the user for the principal, rate of interest, and time, and calculate the accrued amount.
Part H:
Ask for a and b axis lengths for an ellipse and calculate its
area.
Thanks for the question. Here is the completed code for this problem. Comments are included, go through it, learn how things work and let me know if you have any doubts or if you need anything to change. If you are satisfied with the solution, please rate the answer. Thanks =========================================================================== # PART A #Outputs your name here print("John Barak Obama") # Outputs the Assignment Number print('Assignment Number Part A') # prompt for radius radius=float(input('Enter circle radius: ')) # Print Circle radius import math # need to import math module to use pi value print('Area of circle with radius:{} is :{:.2f}'.format(radius,math.pi*radius**2)) #PART B total_sqft=float(input('Enter total square feet of land: ')) acres_equivalent=total_sqft/43560 print('Number of acres in tract is: {0:.2f}'.format(acres_equivalent)) #PART C item_one=float(input('Enter price for item one: ')) item_two=float(input('Enter price for item two: ')) item_three=float(input('Enter price for item three: ')) total_price=item_one+item_two+item_three sales_tax=total_price*0.08 print('Total Price: ${0:.2f}'.format(total_price)) print('Total Tax : ${0:.2f}'.format(sales_tax)) print('Total : ${0:.2f}'.format(sales_tax+total_price)) #PART D total_sales = float(input('Enter total sales: ')) total_sales_A=float(input('Enter total sales for item A: ')) percentage=total_sales_A*100.0/total_sales print('Percentage of total sales of A contributed to is :{0:.2f}%'.format(percentage)) # PART E radius = float(input('Enter circle radius: ')) print('Circumference: {0:.2f}'.format(math.pi*radius*2)) # PART F n = int(input('Enter a positive integer value: ')) total=0 for i in range(1,n+1): total+=i print('Total sum is : {}'.format(total)) # PART G principal = float(input('Enter principal amount: $')) rate_of_interest=float(input('Enter rate of interest as percentage: ')) time = float(input('Enter number of years: ')) accrured_amount = principal+ principal*rate_of_interest*time/100.0 print("Accured Amount will be ${0:.2f}".format(accrured_amount)) # PART H a = float(input('Enter length of axis ellipse: ')) b = float(input('Enter length of axis ellipse: ')) print('Area of ellipse :{0:.2f}'.format(math.pi*a*b))
thank you !
please do give thumbs up : )
Get Answers For Free
Most questions answered within 1 hours.