Question: Getting the right visual output for this problem is pretty easy. Our real goal is to practice writing function definitions and using function calls and

Getting the right visual output for this problem is pretty easy. Our real goal is to practice writing function
definitions and using function calls and function arguments and parameters correctly. For this reason, you
are required to break up your program into the following functions:
draw_body(r, g, b) draws the body of the car, including the front window. The values r, g, and b are
parameters to this function. Use these parameters to set the color of the cars body. The color of the
window however should always be blue.
draw_wheel(x, y) draws just one wheel of the car. A wheel consists of a black outer tire and a white
hubcap. The values x and y are parameters to this function that indicate the (x, y) location coordinates
of the center of the wheel .
draw_car(r, g, b) draws the entire car by making function calls to the functions above. The values
r, g, and b represent the color components of the cars body; these should be pased along as arguments to the draw_body() function. Note that draw_wheel() will have to be called twice (with different
arguments) to draw both wheels!
Each of the functions above must be documented with a docstring that describes what the function does
and the meaning of its parameters. A small number of single-line comments should also be used where
appropriate throughout the program.
The very last line of your program should be a function call to draw_car(), where the colour values for
the cars body are passed in as arguments. For example, a call of draw_car(255,0,0) should produce
the car seen in the sample here, whereas a call of draw_car(0,0,0,0) would produce a black car. This
should be the ONLY place in your code where you specify actual numbers for the color of the car.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!