ubuntu2004
Kernel: Python 3 (system-wide)
COSC - Homework 03
Kyle Anderson
Problem 1: Calculating Exam Scores
In [1]:
Out[1]:
Student 1 Grade: 64%
Student 2 Grade: 84%
Problem 2: Calculating Price of a Bulk Order
In [2]:
Out[2]:
The cost for an order of 248 widgets is $77000.
Problem 3: Creating an Amortization Schedule
In [3]:
Out[3]:
The balance at the end of the year 1 is 900.0
The balance at the end of the year 2 is 795.0
The balance at the end of the year 3 is 684.75
The balance at the end of the year 4 is 568.9875000000001
The balance at the end of the year 5 is 447.4368750000001
The balance at the end of the year 6 is 319.80871875000014
The balance at the end of the year 7 is 185.79915468750016
The balance at the end of the year 8 is 45.08911242187517
The amount of the final payment will be 47.34356804296894
Problem 4: Hailstone Sequences
In [4]:
Out[4]:
hs15:
15 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1
hs17:
17 52 26 13 40 20 10 5 16 8 4 2 1
hs22:
22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1
Problem 5: Preadtor/Prey Model
In [5]:
Out[5]:
Year R_pop W_pop
------------------------
0 1000 200
1 1100 220
2 1166 249
3 1168 286
4 1084 329
5 911 371
6 692 398
7 487 401
8 340 379
9 252 342
10 206 300
11 185 258
12 182 221
13 193 189
14 217 162
15 255 140
16 311 123
17 390 110
18 499 101
19 649 96
20 849 95
21 1112 100
22 1445 114
23 1840 140
24 2244 189
25 2515 279
26 2369 434
27 1497 655
28 283 819
29 -39 725
Problem 6: Finding a Root of a Polynomial Function
In [6]:
Out[6]:
The approximate solution is x = 3.4675039.
The algorithm took 25 iterations to converge.
Problem 7: Grade Database
In [7]:
Out[7]:
SID First Last CID Course Name Grade
---------------------------------------------------------------------
149126 Jason Penopolis ENGL 101 Composition I D
146832 Brendan Small MATH 117 College Algebra C
147354 Melissa Robbins ENGL 104 Composition II B
149735 Fenton Mulley CHEM 103 General Chemistry I A
149126 Jason Penopolis MATH 117 College Algebra B
146832 Brendan Small ECON 201 Macroeconomics C
146832 Brendan Small ENGL 101 Composition I A
149735 Fenton Mulley ENGL 101 Composition I F
149126 Jason Penopolis CHEM 103 General Chemistry I B
147354 Melissa Robbins ENGL 104 Composition II A
147354 Melissa Robbins MATH 151 Calculus I A
149735 Fenton Mulley MATH 117 College Algebra C
Problem 8: Warehouse Inventory
In [8]:
Out[8]:
p101:909
p117:1464
p122:1120
p125:1337
p126:615
The total value of the inventory is $263364.76
In [0]: