Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a python program that allows users to draw SimpleGraphics shapes by issuing commands through the command line. You should ask the user to select

Write a python program that allows users to draw SimpleGraphics shapes by issuing commands through the command line. You should ask the user to select one of three shapes (line, rect or ellipse) and enter the shape specifications and color. The user should enter quit to stop entering input. Your program should save this information on a text file shapes.txt using the following pattern.

 line X1 Y1 X2 Y2 color 

OR

 rect X Y width height color 

OR

 ellipse X Y width height color 

Output sample

rect 200 250 150 300 red line 50 100 300 250 green ellipse 100 400 200 150 blue rect 400 100 75 200 yellow

Write and test a function that reads the content of shapes.txt file and draw those shapes with the given specifications using SimpleGraphics module.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

1. Take initiative, propose ideas, get things started?

Answered: 1 week ago