Question

In: Computer Science

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

Overall Problem (Must be coded in a beginners level python code)

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. 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.

colorsizecost
purple250
light blue350
maroon3100
orange3100
red3150
yellow3150
green3200
dark blue2200

Solutions

Expert Solution

color = input("Which color block will you be building on? ")
m = int(input("How much money do you have to spend? "))
if(color == "purple"):
print("There are 2 properties and each house costs 50 ")
b = (m/50+1)/2
a = b-1
print("You can build "+str(int(m/50))+" house(s) -- 1 will have "+str(int(a))+"and 2 will have "+str(int(b)))
elif(color == "light blue"):
print("There are 3 properties and each house costs 50 ")
b = (m/50+1)/3
a = b-1
print("You can build "+str(int(m/50))+" house(s) -- 1 will have "+str(int(a))+"and 2 will have "+str(int(b)))
elif(color == "maroon"):
print("There are 3 properties and each house costs 100 ")
b = (m/100+1)/3
a = b-1
print("You can build "+str(int(m/100))+" house(s) -- 1 will have "+str(int(a))+"and 2 will have "+str(int(b)))
elif(color == "orange"):
print("There are 3 properties and each house costs 100 ")
b = (m/100+1)/3
a = b-1
print("You can build "+str(int(m/100))+" house(s) -- 1 will have "+str(int(a))+"and 2 will have "+str(int(b)))
elif(color == "red"):
print("There are 3 properties and each house costs 150 ")
b = (m/150+1)/3
a = b-1
print("You can build "+str(int(m/150))+" house(s) -- 1 will have "+str(int(a))+"and 2 will have "+str(int(b)))
elif(color == "yellow"):
print("There are 3 properties and each house costs 150 ")
b = (m/150+1)/3
a = b-1
print("You can build "+str(int(m/150))+" house(s) -- 1 will have "+str(int(a))+"and 2 will have "+str(int(b)))
elif(color == "green"):
print("There are 3 properties and each house costs 200 ")
b = (m/200+1)/3
a = b-1
print("You can build "+str(int(m/200))+"house(s) -- 1 will have "+str(int(a))+"and 2 will have "+str(int(b)))
elif(color == "dark blue"):
print("There are 2 properties and each house costs 200 ")
b = (m/200+1)/2
a = b-1
print("You can build "+str(int(m/200))+"house(s) -- 1 will have "+str(int(a))+"and 1 will have "+str(int(b)))
else:
print("Wrong input")


Related Solutions

You are out playing golf one day with your friends. And you decide to use your...
You are out playing golf one day with your friends. And you decide to use your 60° wedge to play a shot. The start of the green is right at 110 meters away and the back is at 135 meters. Your club has a mass of .33 kg and the golf ball has a mass of 40 grams or .04 kg. You swing the golf club with a speed of 32 m/s. Part 1. Say that we treat this as...
You are playing a dice game with your friend and he seems to be cheating (either...
You are playing a dice game with your friend and he seems to be cheating (either that or you are really bad at this game). You deduce that the dice is not fair. This is, you expect each of the outcomes to be equally likely, but they do not seem to be coming up that way. In order to prove your point, you record the outcomes of 120 different die rolls and obtain the following frequencies. Run a hypothesis test...
for monopoly board game, Suppose you are on “GO”. On your next roll of the dice,...
for monopoly board game, Suppose you are on “GO”. On your next roll of the dice, what is the probability that: a. You land on Jail b. You land on any Light Blue property (Connecticut Ave, Vermont Ave, or Oriental Ave.) c. You land on Mediterranian Ave d. You land on Chance or Community Chest 2. Suppose you are on “Jail” a. What space (or spaces) is/are most likely to be landed on on your next roll? Justify your response....
Suppose you are a monopoly in the market for a specific video game. Your demand curve...
Suppose you are a monopoly in the market for a specific video game. Your demand curve is given by P = 100 - Q / 2, and your marginal cost curve is Cm = 20. Your fixed costs are $ 300. a. Graph the demand and the marginal cost curves. b. Derive and plot the marginal income curve on the same graphic above. c. Calculate and indicate on the graph the price and quantity monopolistic. d. What is your profit?...
Scenario 1: You are playing soccer and your team has just finished their third game of...
Scenario 1: You are playing soccer and your team has just finished their third game of the day. The day has been very hot with temperatures in the 90s with no cloud coverage. Suddenly, one of your teammates collapses. They seem to not be fully awake and do not respond to questions you ask them. Their breathing is rapid and shallow, and they are unable to get up from the ground. Their skin is very red and hot to the...
Children are playing a game of ice hockey on a frozen lake. One of the children...
Children are playing a game of ice hockey on a frozen lake. One of the children throws a 1200g water bottle with velocity 0.4 m/s to another kid, weighing 41 kg, sitting motionless on the ice who catches the bottle 0.2 m from their COM at angle of impact of 12 degrees. The child on the ice has a center mass moment of inertia of 38 kg m^2. Assuming the ice is perfectly friction-less, answer the following. 1.) How does...
Suppose you are playing a game with a friend in which you bet ? dollars on...
Suppose you are playing a game with a friend in which you bet ? dollars on the flip of a fair coin: if the coin lands tails you lose your ? dollar bet, but if it lands heads, you get 2? dollars back (i.e., you get your ? dollars back plus you win ? dollars). Let ? = "the amount you gain or lose." (a) What is the expected return ?(?) on this game? (Give your answer in terms of...
Suppose that you and a friend are playing cards and you decide to make a friendly...
Suppose that you and a friend are playing cards and you decide to make a friendly wager. The bet is that you will draw two cards without replacement from a standard deck. If both cards are hearts, your friend will pay you $⁢16. Otherwise, you have to pay your friend $⁢3. Step 2 of 2 :   If this same bet is made 762 times, how much would you expect to win or lose? Round your answer to two decimal places....
6. You are playing a card game with a friend. You are using a new deck...
6. You are playing a card game with a friend. You are using a new deck of 52 playing cards and you’d like to calculate some probabilities to improve your game. (Remember, the total number of cards decreases by 1 every time you draw a card!) a. What is the probability of drawing three queen cards in a row? b. What is the probability of drawing all four aces in a row? c. What is the probability of drawing the...
6. You are playing a card game with a friend. You are using a new deck...
6. You are playing a card game with a friend. You are using a new deck of 52 playing cards and you’d like to calculate some probabilities to improve your game. (Remember, the total number of cards decreases by 1 every time you draw a card!) a. What is the probability of drawing three queen cards in a row? b. What is the probability of drawing all four aces in a row? c. What is the probability of drawing the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT