Question: Language: Python For this problem, we have 3 balls of different weights. Your job is to write a program that allows the user to place
Language: Python


For this problem, we have 3 balls of different weights. Your job is to write a program that allows the user to place the balls on either side of a scale and reports which side of the scale is heavier The left sc le is heavier. Figure 2: An example wih all balls currently on the left-hand scale Here is a description of how your program should look Use a 400x30O canvas size Colour half of the screen white and the other half black. Each half of the screen represents one side of a scale Display 3 balls on the canvas. Each ball has a different weight (1kg, 2kg and 3kg). Each ball should be a different colour, and heavier balls should be bigger Display at all times on the canvas a message indicating whether the scale is balanced, or if not, which side is heavier, based on the position of the balls Here is a description of how your program should behave . Initially, the balls can be anywhere on the screen. In the example above, they are all on the left-hand side of the scale When the user presses '1: The 1kg ball should be moved to the location of the mouse When the user presses '2': The 2kg ball should be moved to the location of the mouse When the user presses '3': The 3kg ball should be moved to the location of the mouse Of course, the message concerning which side of the scale is heavier should be kept up to date as the balls move Here are some suggestions for how to design your program, especially with regard to the Model-View- Controller design pattern. . You will want to use at least 6 global variables in your program: these are the current x and y coor- dinates for each of the three balls. You may wish to use another 3 global variables for the weight of each ball as well, although since the weights do not change, this is not strictly necessary
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
