Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / turtle graphics to make interactive menu-based drawing application

turtle graphics to make interactive menu-based drawing application

Computer Science

turtle graphics to make interactive menu-based drawing application.

The application will initially show an empty drawing screen and present the user with the following main menu:

[L]ine

[A]rc

[T]ext

[S]ettings

[Q]uit

 

The user selects the menu command by entering the letter (case insensitive). The following prompts will depend on the selected option. For example, the following are the prompts for the Line command:

Line > x1 (default current x coordinate):

Line > y1 (default current y coordinate):

Line > x2:

Line > y2:

 

After the Line parameters are accepted, the program should draw a line on the drawing screen, store the current x and y coordinates, and return back to the main menu. Use the same approach for other commands.

 

The Arc command will accept two parameters: radius and angle. It will draw a partial circle with those parameters.

 

The Text command will accept four parameters: content, size, x and y coordinates. It will write the entered content on the screen with specified size at the specified coordinates.

 

The Settings command will show the following prompts:

Settings > Pen colour (default no change):

Settings > Pen thickness (default no change):

The entered values will apply to any future drawing commands.

  1. You must make a module called xyz.py that contains at least the following functions:
  • line(x1, y1, x2, y2)
  • text(content, size, x, y)
  • arc(radius, angle)
  • settings(colour, thickness)
  1. You must also use global variables for the colour and thickness values, as well as the current x and y coordinates.
  2. In your main program, you must import the module easyshape. You must not import any modules other than turtle and your own created modules. 

 

Draw a flowchart of your menu handling algorithm. You can abstract the defined functions using function symbols, but the main flowchart should provide sufficient level of details for the logic of your algorithm.

 

Implement your program in Python.

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE