Question: In this problem, you are asked to write a program makeSVG.cpp that creates a scalable vector graphics (svg) file with shapes based on input read
In this problem, you are asked to write a program makeSVG.cpp that creates a scalable vector graphics (svg) file with shapes based on input read from standard input. An svg file can be visualized using a browser such as Firefox, Safari, Chrome or Internet Explorer. See https://en.wikipedia.org/wiki/Scalable_Vector_Graphics.
Your svg file should use the same template as template.svg. Each line of input defines a shape to be added to the line(s) indicated in template.svg. The first character on each line determines whether the shape is a circle (C) or a rectangle (R). The position and size of the shape is described by integers in the rest of the input line.
A rectangle is specified by the position of its lower left corner, its width and its height. Example: Rectangle with corners at (10,20), (40,20), (40,60), (10,60) R 10 20 30 40 A circle is specified by the position of its center and its radius
Example: Circle centered at position (30,40) with radius 20
C 30 40 20
It can be assumed that input will consist of valid characters (only R or C) and the appropriate number of positive integers. Use the test cases to check your program and match the test svg files exactly.
Create a tar file hw3p1.tar containing makeSVG.cpp and the Makefile. Submit your tar file using $ handin cs36b hw3 hw3p1.tar
///////////////////////////////////////
template.svg code:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
