ubuntu2004
Kernel: Python 3 (system-wide)
COSC130 - Homework 01
Kyle Anderson
Problem 1: Arithmetic and Geometric Means
In [1]:
Out[1]:
Sum: 60
Product: 46189
Arithmetic Mean: 15.0
Geometric Mean: 14.66
Problem 2: Calculating Bill
In [2]:
Out[2]:
2 Side Salads: $ 7.90
2 Hamburgers: $17.90
2 Diet Sodas: $ 5.00
----------------------
Subtotal: $30.80
Tax (4.75%): $ 1.46
Tip (15%): $ 4.62
----------------------
Total Charge: $36.88
Problem 3: Volume of a Sphere
In [3]:
Out[3]:
The volume of a sphere with radius 4.6 is equal to 408.187
The volume of a sphere with radius 7.2 is equal to 1565.248
The volume of a sphere with radius 9.7 is equal to 3827.373
Problem 4: Simple Interest
In [4]:
Out[4]:
Amount repaid: $225.75
Problem 5: Compound Interest
In [5]:
Out[5]:
Amount repaid: $241.50
Problem 6: Annuity
In [6]:
Out[6]:
Balance after 18 years: $51290.83
Problem 7: Probability
In [7]:
Out[7]:
Probability that both people are late: 0.18
Probability that at least one person is late: 0.72
Problem 8: Constucting an Output Message
In [8]:
Out[8]:
First Name: first
Last Name: last
Student ID: 1234
In [9]:
Out[9]:
53
50