Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are playing the game of Monopoly and you decide you wish to construct houses on one of your property groups. The rules of the

image text in transcribedimage text in transcribedimage text in transcribed

You are playing the game of Monopoly and you decide you wish to construct houses on one of your property groups. The rules of the game require that the number of houses on the properties within each group may not differ by more than one. You will be given an amount of money to spend, and the color Monopoly uses on the game board for a group of properties (see chart below). The goal is to determine how many houses will go on each. And to appear more conversational, the last line of output will use words to represent numbers instead of digits. . To make the program simple, you may assume that you will not have enough money to build past four houses per property (twelve total). You do not need to convert the price of a house to a word (although that can be done rather simply). Monopoly Property Groups Here is a small table relating the colors of the monopoly property groups, the number of properties within the group, and the cost of the houses. Sample Interfaces Which color block will you be building on? orange Each house costs 100 on the three orange properties. How much money are you able to spend? 860 You can build eight house(s) -. one may have two and two may have three Which color block will you be building on? yellow Each house costs 150 on the three yellow properties. How much money are you able to spend? 660 You can build four house(s) -. two may have one and one may have two Which color block will you be building on? maroon Each house costs 100 on the three maroon properties. How much money are you able to spend? 660 You can build six house(s) -. three may have two and none may have three Which color block will you be building on? dark blue Each house costs 200 on the two dark blue properties. How much money do you have to spend? 250 You can build one house(s) -. one may have none and one may have one Presentation of output must attempt to resemble what is shown. All five computed values in that last output line must be present and correct. It is expected that lists and dictionaries will be sufficient for this entire problem. There should be nothing from later in the course. Code that uses if-statements or loops from Unit 3 will not earn a grade for this assignment. When strings are provided as input instead of numbers, sometimes a valid input is not quite recognized as what the user intended. There may be extra space characters before or after the input; or a user might capitalize a letter that was not expected. This can often prove to be very frustrating to that keyboard user, if he consistently types 'Red' as a color and is told that the input is incorrect, or if something about the prompt lures him into typing a space first (' red' and ' red' are not considered by Python to be the same as 'red') The string object (str) in Python has some functions that can help with that. The most direct way to find that information is to go into Python IDLE and type help(str) Two of the three most helpful methods will be in the latter part of that very long list (on the last screenful or two). If you use them to reinterpret the input data, then you can be more flexible on what inputs are accepted. Incidentally, Cengage Unit 4.4 talks about string methods and how to use them (which can be informative), but it turns out that the short list of examples they use to illustrate does not include any of the functions that help with this particular problem. Extra Credit Option Use the features of the Python language to show the colors to choose from. They should appear all in a row, separated by commas, and without any enclosing punctuation ([], (), or [3) appearing. For example, The block colors in Monopoly are: violet, pale blue, maroon, orange, red, yellow, green, dark blue Which color block will you be building on? dark blue Do so without either (1) referring to each of the colors individually, either by its name or a variable holding its name, (2) making a new variable just for purposes of this feature, or (3) using any loop from later in the course. Instead, for any credit the program code must use features of the Python language to display the choices, as they appear in the data you use for the rest of the program. Maximal credit will be applied to the simpler solutions, based on number of additional operations required to accomplish

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_2

Step: 3

blur-text-image_3

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

Development Of Knowledge Framework For Affective Content Analysis

Authors: Swarnangini Sinha

1st Edition

B0CQJ13WZ1, 979-8223977490

More Books

Students also viewed these Databases questions