Question
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, the cost per house, and the number of properties in the group. The goal is to determine how many houses will go on each.
To make the program simple, you may assume that you will not have enough money to build past four houses, so there needs to be no special cases for hotels.
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       size    cost
purple       2       50
light blue   3       50
maroon      3       100
orange      3       100
red            3       150
yellow       3       150
green         3       200
dark blue   2       200

Extra Credit Option
Sometimes there are houses already present, that will be added to.
Allow the user to input the number of houses on each property already.
To simplify the program just let the user input three values. even if there are only two properties in the
group. For example, which colon you be building dark blue
Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references.
Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.

# variable to store colors
colors = ['purple', 'light blue', 'maroon', 'orange', 'red', 'yellow', 'green', 'dark blue']
# variable to store sizes
sizes = [2, 3, 3, 3, 3, 3, 3, 2]
# variable to store costs
costs = [50, 50, 100, 100, 150, 150, 200, 200]
# prompt user for color
color = input("Which color block will you be building on? ")
# prompt user for budget
budget = int(input("How much money do you have to spend? "))
# find index of color
index = -1
for i in range(len(colors)):
    if colors[i] == color:
       index = i
This is only a preview of the solution.
Please use the purchase button to see the entire solution.
By purchasing this solution you'll be able to access the following files:
Solution.py
Purchase Solution
$27.00
Google Pay
Amazon
Paypal
Mastercard
Visacard
Discover
Amex
View Available Computer Science Tutors 641 tutors matched
Ionut
(ionut)
Master of Computer Science
Hi! MSc Applied Informatics & Computer Science Engineer. Practical experience in many CS & IT branches.Research work & homework
5/5 (6,803+ sessions)
1 hour avg response
$15-$50 hourly rate
Pranay
(math1983)
Doctor of Philosophy (PhD)
Ph.D. in mathematics and working as an Assistant Professor in University. I can provide help in mathematics, statistics and allied areas.
4.6/5 (6,660+ sessions)
1 hour avg response
$40-$50 hourly rate
Leo
(Leo)
Doctor of Philosophy (PhD)
Hi! I have been a professor in New York and taught in a math department and in an applied math department.
4.9/5 (6,421+ sessions)
2 hours avg response

Similar Homework Solutions