Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 165
Image: ubuntu2004
Kernel: Python 3 (system-wide)

Question 1

I pledge to be fair to my classmates and instructors by completing all of my academic work with integrity. This means that I will respect the standards set by the instructor and institution, be responsible for the consequences of my choices, honestly represent my knowledge and abilities, and be a community member that others can trust to do the right thing even when no one is watching. I will always put learning before grades, and integrity before performance. I pledge to excel with integrity.

import matplotlib.pyplot

x.jpg

# Question 2 # x= small rides , y= large rides, c = cost def rides(x,y): cost=(2*x)+ (5*y) if(cost>=50): cost=50 print("total cost:",cost) x=int(input("Enter x:")) y=int(input("Enter y:")) rides(x,y)
Enter x:
Enter y:
total cost: 12
#3 a (chart below)

x.jpg

#3b def finalsum(n): sum=0 for i in range(1,n+1): sum=sum+ (1/i) print(sum) n= int(input("Enter n:")) finalsum(n)
Enter n:
1.0 1.5 1.8333333333333333 2.083333333333333 2.283333333333333
#4a after 12 years, theres 1760.87 dollars in the account 1200*(1+.032/12)**(12*12)
1760.8743319263763
# 4 b You need to deposit 10.14 monthly to get at least 5000 dollars (5000)*(.032/12)
13.333333333333332
#5 a
#5 b there are 28 ways def stair(x): if x == 3: return 2 elif x<3: return 1 else: return stair(x-1)+stair(x-3) stair(10)
28
# 6 p(x) = x**3 - 2*x+3 +3 plt.plot (p)