Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CS230 Assignment 2: Control Structures

Spring 2023

Due 11:59 PM, Sunday, Feb 26

Project Description : Sheds

New England’s Best Sheds sells sheds of two styles: (a) Traditional Gambrel and (b) Victorian Cottage. You are asked to write a program to help the store process customer orders.

The program asks the customer to choose the style (Gambrel or Cottage), size (Small, Medium, or Large), and siding material (Duratemp, Vinyl, or Cedar). Additional windows ($120 per window) are available for purchase for medium or large sheds. Shipping and installation are free throughout the New England. The sales tax rate is 6.25%.

The pricing information is as follows:

When checking out, the customer can make a full payment or choose either the 12-month or 24-month  payment financing option. If the customer chooses either of the financing option, the program prints out the monthly payment schedule with monthly principle, interest, and total payment based on an amortization schedule with a 6% annual interest rate (corresponding to a monthly interest rate of 6%/12 = 0.5%).

The formula for calculating the monthly payment is

where Principal is the order’s total price, r is the monthly interest rate (0.5%), and n is the number of payment months (12 or 24). For example, if the total price of the order is $8,000 and the customer    chooses to repay in 12 months, the monthly payment amount will be $688.53.

As illustrated here, with an amortization schedule, although the monthly payment is fixed, the interest (and principal) amount is not the same every month. In general, the interest portion of the monthly payment is relatively large at the beginning and gradually drops. Accordingly, as time progresses, the   principal portion of the monthly payment gradually increases because the remaining loan balance (i.e., the principal) decreases. To calculate the monthly numbers, you can use the following formulas:

Remaining Balance = Original Principal Principal Already Paid

Monthly Interest = Remaining Balance * r

Monthly Principal Paid = Monthly Payment Monthly Interest

Requirements and Hints

1.   You are prohibited from importing any Python library (e.g., numpy-financial) or package that we have not covered in class yet.

2.    Include a docstring comment at the beginning of your program with the program/file name, your  name, date, and a short description of the program, and the statement certifying you completed this work individually.

3.    Your program must be able to accept both upper- and lower-case inputs (e.g., g or G, c or C). To    avoid using the OR operator too many times, you may convert all inputs to upper-case letters, e.g.,

4.    Format all prices with two decimal places, dollar signs, and commas for values greater than $999.99.

5.    Use appropriate variables to keep track of the monthly numbers.

6.    You can ignore the ‘-‘ sign in ‘-0.0’ showing at the last row of the Remaining Balance column.

7.    Check out the sample interactions for additional clues.

Rubrics and Grading Policy

This assignment will be worth 10 points toward your final grade.

Your program should compile without syntax errors to receive any credit. If a part of your program is working, you will receive partial credit, but only if the program compiles without syntax errors. Your grade will be zero on this assignment if it contains any syntax errors.

Rubrics

Points

Include a docstring at the beginning of the program

2

Use symbolic constants for the prices of each option, tax rate, and window price

2

Accept both upper- and lower-case letters for each question/prompt

2

Be able to handle input errors

6

Calculate the order total and print out the order summary properly

10

Print correct payment schedule if the customer chooses a financing option

8

Correctly format the numbers with decimal points, comma, and $

4

The format of order summary and payment schedule must match the format in the sample interactions shown with columns, tabs, and justified vales.

6

Total

40

Submission

Name your Python script as shed.py. Test it to make sure it works with various input values. Submit it on Blackboard before the deadline. Points will be taken off if you do not follow this naming rule.

Sample Interactions

Sample Run #1


Sample Run #2

Sample Run #3

Sample Run #4: Error Handling