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 5,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. 65230 5priog-2023 HW2-sobaion C5230 5 oving- 2023 Program output Your program should preduec the following output, as dernonstrated by the sample interacilans - A summy of te neriete indubing al denaik, - If the custome- thooses eithe- of the finaing cptions, print out the monthly poymert sthedule with monthly (catrespereine to a menthly interest rate of 6,120.5% ). Ta cakulate the menthly numbers, use the follawing formulas: - 5AMPLE INTERACTION5 Homework 42 Soring 2023 Page 2 C5230 5 soing- 2023 HW/2-5obuion 1. Do not use any libeary \{e.E, numpy-financial) or package that we have not cavered in class. 2. Include a docstring comment at the beeinning 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. enclased 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 ' ' sign in '-0,0' showing at the last row of the Remaining Balance column. 5. Examire the sample interactions carefully for adtitional clues. HINTS 1. Examples from class and in the texthock demenstrate haw to run a validatian laop for dato input, how to format numbers for alienment, how to print a table, how to compute a total sum, and more - durit ignore the textbook and in -llass examples that are posted - studying them ahead of tirne will save you time developing this program. 2. The table of payments does not need nested loaps - each row can be printed within one iteration of a for-loop. 3. To simplify the test for upper or lawercase user input, you may convert all inputs ta upper-case letters, c.g. style = 1nput("Please select the shed style ([0]arbrel, [c]ottape): ").upper 0) SUBMISSION AND GRADING Always test your program to make sure it warks using a variety af coses. Once yau have campleted your hornewark submit yaur Python file an elarkbaird. As hefore [and always in this class]: 1. Your pragram sheuld compile without spntak errars to receive any credit. If a part af yaur progrom is working, you will reccive portial credit, but anly if the pragram cempiles withaut ayntax errars. Your grade will be zero on this assignment if it contains any syntac errors. 2. Your proeram will be tested by a computer program before l evaluate it. The tester proeram is not intelligent enough to interpret the output. Therefore, for full credit, the input and catput of your program must appear in exactly the order that is shown in the sample interactions. Homework a2 5oring 2023 Page 6 Homework a2 5pring 2023 Page
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
