Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Stuck on this and dont know how to program it without range. (Updated 2/11/209, 3:36 pm) CSc 110- Short PA Shaper In this programming assignment,
Stuck on this and dont know how to program it without range.
(Updated 2/11/209, 3:36 pm)
CSc 110- Short PA Shaper In this programming assignment, you will be writing a program that prints out several shapes via text. In this PA, you will be required to use functions and parameters. This is both to reduce redundancy and to make your code clean and well-structured. Name your program shaper.py Your program should have the capability to print out three different shapes: An hourglass, a plumbbob, or a (housel. Below is a table that shows examples of each of these shapes. hourglass plumbbob house Notice that there are some common shapes within these larger shapes. All three utilize the ine. All three utilize an upward-facing arrow. Both the hourglass and the plumbbob Have a downward-facing arrow. The characters in the arrows may differ, but the overall shapes are the same (other than the two directions). Input Values Your program should accept two values as input. The first should be a selection of the shape to print. It should check for hourglass plumbbob, and house. After asking for the shape, the program should ask for a single character, which should be used for the arrowls). It should also ask for an integer, which will determine the number of [.....rows to print out at one or more location(s) in the shape If a supported shape is entered, the program should print out that shape utilizing the character for the arrow(s). If none of the three valid shapes are entered, the program should print out a message and then the program can end. You do not need to validate the single-character or integer input. See the examples to determine what the prompts and message should be Program Structure In your program, you should write a function that allows you to print out these three sub-shapes. You should write one function for the upward-facing arrow, one for the downward-facing arrow, and one to print any number of rows of.....-. Each of these functions should take one parameter. The two arrow functions should take the character that the arrow should be made up of as Input Values Your program should accept two values as input. The first should be a selection of the shape to print. It should check for hourglass lumbbob,and house, After asking for the shape, the program should ask for a single character, which should be used for the arrowls). It should also ask for an integer, which will determine the number of .- rows to print out at one or more location(s) in the shape If a supported shape is entered, the program should print out that shape utilizing the character for the arrow(s). If none of the three valid shapes are entered, the program should print out a message and then the program can end. You do not need to validate the single-character or integer input. See the examples to determine what the prompts and message should be. Program Structure In your program, you should write a function that allows you to print out these three sub-shapes. You should write one function for the upward-facing arrow, one for the downward-facing arrow, and one to print any number of rows of D Each of these functions should take one parameter. The two arrow functions should take the character that the arrow should be made up of as a parameter. The row function should accept an integer, which will determine the number of rows to print Restrictions You should follow the style guide You must have a main function No function should be longer than 30 lines, including comments You should have at least 4 purposeful functions . . . o o o One for the up-arrow One for the down arrow Amain function .You may not have any code that is not in a function, other than a call to main Examples Enter shape to display: plumbbob Enter arrow character: Enter shape to display: house Enter arrow character: Enter shape to display: Enter shape to display: house Enter arrow character: Enter row-area height: Enter row-area height: Enter row-area height: in your progrdm, you should wrire d Tuncrlon That allows you to print our rhese tnree Sub-shidpes. You should wrire one Tuncrion Tor the upward-facing arrow, one for the downward-facing arrow, and one to prnt any number of rows of functions should take one parameter. The two arrow functions should take the character that the arrow should be made up of as a parameter. The row function should accept an integer, whic Each of these ermine the number of rows to print Restrictions You should follow the style guide You must have a main function No function should be longer than 30 lines, including comments You should have at least 4 purposeful functions . . o One for the up-arrow o One for the down arrow o Amain function You may not have any code that is not in a function, other than a call to main Examples Enter shape to display: plumbbob Enter arrow character: Enter shape to display: house Enter arrow character: Enter shape to display: Enter shape to display: house Enter arrow character: Enter row-area height: Enter row-area height: Enter row-area height: There will be additional test cases on Gradescope. Turning it In This program is due Tuesday, February 12th at 7:00pm. Turn it in on Gradescope. You should get your submission to pass as many of the test cases as possible. Also, ensure that your code conforms to the code style requirements
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started