Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that writes a command parser that provides a textual input interface to your program. It should create, delete, modify or display

Write a C++ program that writes a command parser that provides a textual input interface to your program. It should create, delete, modify or display shapes to be drawn. Create a database of objects to store the shapes using classes. Also create and maintain dynamically allocated arrays of points to shape objects to keep track of the objects created and deleted. You do not have to draw the shape, just process the command and maintain the database of the shape.

The input and outputs must be only done using C++ streams cin and cout. The input operator and associated functions such as fail() and eof() should be used for all outputs. You cannot use any C-library conversions such as atoi, strtol etc.

Below are the arguments that should be created and what error message should be displayed if incorrectimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Command Arguments maxShapes value create move rotate draw draw delete delete Output if Command is Valid New database: max shapes is value Created name: type loc loc size size Moved name to loc loc Rotated name by angle degrees Drew name: type loc loc size size Drew ll shapes Deleted name Deleted all shapes name type loc loc size size name loc loc name angle all name all Command Arguments maxShapes value create move rotate draw draw delete delete Output if Command is Valid New database: max shapes is value Created name: type loc loc size size Moved name to loc loc Rotated name by angle degrees Drew name: type loc loc size size Drew ll shapes Deleted name Deleted all shapes name type loc loc size size name loc loc name angle all name all

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

The Millionaire Next Door The Surprising Secrets Of Americas Wealthy

Authors: Thomas J. Stanley, William D. Danko

1st Edition

1589795474, 978-1589795471

Students also viewed these Databases questions