Question: CS230 Spring-2023 HW2-Babaian PROGRAMMING ASSIGNMENT 1: SHEDS (40 POINTS) New England's Best Sheds sells sheds of two styles and a variety of sizes and sidings.







CS230 Spring-2023 HW2-Babaian PROGRAMMING ASSIGNMENT 1: SHEDS (40 POINTS) New England's Best Sheds sells sheds of two styles and a variety of sizes and sidings. You are asked to write a program to help the store process customer orders. The program must work as follows: Input 1. Ask the customer to enter: a) the first letter of the shed style - G or C ( G, for Gambrel, or C, for Cottage), using upper or lower case letters, b) the first letter of the shed size - S, M, or L (Small, Medium or Large item, respectively), using upper or lower case, c) the first letter of the shed siding material - D, V, or C (D for Duratemp, V for Vinyl, or C for Cedar), using upper or lower case. Note that Cedar siding is not available for large sheds and that Duratemp siding is not available for large cottages For each of the above inputs you must validate the input, which means continue reading the input in a loop until a valid and available option is entered, as demonstrated in SAMPLE RUN \#4 on page 5 . 2. If Medium or Large shed was selected, ask the user to specify the number of additional windows - a valid value is up to 4 . 3. Ask the user to enter the payment option: F,O, or T, which respectively mean Full payment, Oneyear financing, and Two-year financing options. As before, accept upper as well as lowercase letters and repeat input until you get a valid payment option. Calculate Pricing Compute the total price for the purchased shed by following the rules below: R1. The base price of a small model with Duratemp siding is $5,500 for Gambrel, and $5,800 for Cottage sheds. R2. The added prices of the other siding options are: Vinyl - $500 and Cedar - $1,200 R3. The added prices of larger sheds are: Medium - $1,700, Large $2,500 The table on the next page illustrates the above pricing rules R4. Windows are charged $120 per window R5. The sales tax rate is 6.25%. R6. Financing: unless Full payment option is selected, a 6% annual interest rate (corresponding to a monthly interest rate of 6%/12=0.5% ) applies to the payments. The formula for calculating the monthly payment is MonthlyPayment=(1+r)n1Principal*r*(1+r) 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. cS230 Spring-2023 HW2-Babaian Program output Your program should produce the following output, as demonstrated by the sample interactions - A summary of the order, including all details, - If the customer chooses either of the financing options, print out the monthly payment schedule with monthly principle, interest, and total payment based on an with a 6% annual interest rate (corresponding to a monthly interest rate of 6%/12=0.5% ). To calculate the monthly numbers, use the following formulas: Remaining Balance = Original Principal Principal Already Paid Monthly Interest = Remaining Balance r Monthly Principal Paid = Monthly Payment Monthly Interest Please select the shed style ([G]ambrel, [C]ottage): c Please select the size ([S]mall, [M]edium, [L]arge): m Please select the siding material ([D]uratemp, [V]inyl, [C]edar): c How many additional windows would you like ? 2 Please choose your payment option ([F]ull, [O]ne-year, [T]wo-year): o Please choose your payment option ([F]ull, [O]ne-year, [T]wo-year): t Your Mnnthlu Davment Grhediule. Homework \#2 Spring 2023 Page 4 Please choose your payment option ([F]ull, [O]ne-year, [T]wo-year): 3 Invalid payment option! Please choose your payment option ([F]ull, [O]ne-year, [T]wo-year): 2 Invalid payment option! Please choose your payment option ([F]ull, [O]ne-year, [T]wo-year): T Your Monthly Payment Schedule: Homework \#2 Spring 2023 Page 5 1. Do not use any library (e.g., numpy-financial) or package that we have not covered in class. 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. A docstring is a comment in the top of the program, enclosed in "'s 3. Format all prices with two decimal places, dollar signs, and commas for values greater than $999.99. 4. You can ignore the 44sign in "0.0 ' showing at the last row of the Remaining Balance column. 5. Examine the sample interactions carefully for additional clues. HINTS 1. Examples from class and in the textbook demonstrate how to run a validation loop for data input, how to format numbers for alignment, how to print a table, how to compute a total sum, and more - don't ignore the textbook and in -class examples that are posted-studying them ahead of time will save you time developing this program. 2. The table of payments does not need nested loops - each row can be printed within one iteration of a for-loop. 3. To simplify the test for upper or lowercase user input, you may convert all inputs to upper-case letters, e.g.r style=input("Pleaseselecttheshedstyle([G]anbrel,[c]ottage):").upper() SUBMISSION AND GRADING Always test your program to make sure it works using a variety of cases. Once you have completed your homework submit your Python file on Blackboard. As before (and always in this class): 1. 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. 2. Your program will be tested by a computer program before I evaluate it. The tester program is not. intelligent enough to interpret the output. Therefore, for full credit, the input and output of your program must appear in exactly the order that is shown in the sample interactions. Homework \#2 Spring 2023 Page 6 Spring-2023 HW2-Babaian
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
