Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I can't figure out why I'm getting errors. Python, juypter notebook here's a link to my code https://1drv.ms/u/s!Ag1z98RJIGytlUOfebP_G2zB8JJt Downloads/ X w 03 ohlson - Jupyter

I can't figure out why I'm getting errors.

Python, juypter notebook

image text in transcribed

image text in transcribed

here's a link to my code

https://1drv.ms/u/s!Ag1z98RJIGytlUOfebP_G2zB8JJt

Downloads/ X w 03 ohlson - Jupyter Notebo X + G O / localhost:8889otebooks/Downloads/hw_03_ohlson.ipynb jupyter hw_03_ohlson (autosaved) () Logout File Edit View Insert Cell Kernel Widgets Help Not Trusted Python 3 (ipykernel) O + 9 Run 1 C Code print("Student 2 Grade:", grade2,"") Student 1 Grade: 644 Student 2 Grado: 84 + Problem 2 In (13): N Tuantitics - [84,100,126,150,186,200,216,248] N (] for i in quantities: 11 widgets of 6 - ZOOM Problem 2: Calculating Price of a Bulk Order WideCo is a company that sells widgets. The company uses the bulk pricing policy described below. If 100 or fewer widgets are ordered, then each widget costs $350. if 200 or fewer widgets are ordered, the first 100 widgets each cost $350, and each additional widget costs $300. If more than 200 widgets are ordered, then the first 100 each cost $350, the next 100 each cost $300, and each widget beyond the first 200 will cost $250. In this problem, you will determine the price for orders containing the following numbers of widgets: 84, 100, 126, 150, 186, 200, 216, 248 . . Perform the following steps in a single code cell: 1. Create a list named quantities to store the order quantities mentioned above. 2. Loop over this list. Each time the loop executes, perform the following steps: Calculate the price of the order. Print a message in the format shown below, with the xxo symbols replaced by the appropriate values. Match the format exactly, including the period at the end of the sentence. Do not include extra spaces. The cost for an order of xxxx widgets is $xxxx. Only one list should be created for this problem, and only one loop should be used. Your loop should contain only one print statement. Problem Creating an Amortization Schedule Suppose that $1000 is borrowed at the beginning of the year. The loan is charged interest at an annual interest rate of 5%. The borrower will repay the loan by making payments of $150 at the end of the year until the loan is repaid. Note that when the final payment is made, the balance will be less than $150, and so a partial payment will be made at that time. Perlorm the following steps in a single code cell . 1. Create variables named balance, i and pet to store the initial loan amount, annual interest rate, and annual payment amount mentioned in the paragraph above. Also create a variable n to track the number of payments. 2. Use a while loop to perform the tasks described below. The loop should continue to execute for as long as the balance of the loan is greater than 0. Increase the number of payments that have been made by 1. Calculate the new balance. This will be done by multiplying the current balance by 1+i, and then subtracting the payment amount. Store the result back into balance, rounded to 2 decimal places. If the new balance is less than 0, then calculate the the final payment amount. This will be equal to the new balance plus the payment amount. Then set the balance to 0. Print the message below, with the xxxx symbols replaced with the appropriate values. Match the

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

6-5 How will MIS help my career?

Answered: 1 week ago

Question

=+ Are they breakable for any reason?

Answered: 1 week ago

Question

=+When and under what circumstances are contracts renegotiated?

Answered: 1 week ago

Question

=+Are the contracts enforceable?

Answered: 1 week ago