Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- How do you code this when there can be no if-statements or loops and only lists and dictionaries? Overall Problem You are playing the

image text in transcribedimage text in transcribed

- How do you code this when there can be no if-statements or loops and only lists and dictionaries?

Overall Problem 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. color purple light blue cost 50 50 maroon 100 orange red 100 150 150 yellow green dark blue 200 200 Sample Interfaces Which color block will you be building on? orange How much money do you have to spend? 860 There are three properties and each house costs 100 You can build eight house(s) -- one will have two and two will have three Which color block will you be building on? green How much money do you have to spend? 660 There are three properties and each house costs 150 You can build four house(s) -- two will have one and one will have two Which color block will you be building on? maroon How much money do you have to spend? 660 There are three properties and each house costs 100 You can build four house(s) -- three will have two and none will have three Which color block will you be building on? dark blue How much money do you have to spend? 250 There are two properties and each house costs 200 You can build one house(s) -- one will have none and one will have one Exact spacing and spelling is not required -- correct calculation is far more important. 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. Overall Problem 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. color purple light blue cost 50 50 maroon 100 orange red 100 150 150 yellow green dark blue 200 200 Sample Interfaces Which color block will you be building on? orange How much money do you have to spend? 860 There are three properties and each house costs 100 You can build eight house(s) -- one will have two and two will have three Which color block will you be building on? green How much money do you have to spend? 660 There are three properties and each house costs 150 You can build four house(s) -- two will have one and one will have two Which color block will you be building on? maroon How much money do you have to spend? 660 There are three properties and each house costs 100 You can build four house(s) -- three will have two and none will have three Which color block will you be building on? dark blue How much money do you have to spend? 250 There are two properties and each house costs 200 You can build one house(s) -- one will have none and one will have one Exact spacing and spelling is not required -- correct calculation is far more important. 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

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

Step: 3

blur-text-image

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

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions