<aside>
🔺 Write a CLI that accepts commands to create, delete, modify, and display shapes on the screen, then implement a simple database to store the shapes created
</aside>
- Parser should take input from the standard input, verify its correctness, and then print a response or an error message
- Parser should also create, delete, or modify Shape objects accordingly
Shape
class will store properties of each shape, and database will by dynamically allocated array of pointers to Shape
objects to track the created and deleted shapes
TODO
- [ ]
cin.peak
for non space separated input
- [ ] Check if arguments are valid before executing the command
- [ ] All printing is done in the main method
4.1 Coding Requirements
- Code should be contained in two files:
parser.cpp
and Shape.cpp
- Two header files
globals.h
and Shape.h
are provided and should not be modified
- Helper functions can be used for code readability but should be within the two mentioned
.cpp
files.
- No additional
.h
or .cpp
files can be added
- Only C++ standard library streams
cin
and cout
should be used for input and output.
- The stream input operator
>>
and functions like fail()
and eof()
should be used for all input, excluding C-style IO
- Strings should be stored using the C++ library type
string
- Operations on these strings should use class members, avoiding C-style strings. C-library string-to-integer conversions, like
atoi()
, should not be used
4.2 CLI
- Commands are provided one at a time on a single line.
- The program should indicate its readiness for input with a
>
prompt.