SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Walter Savitch ,julia Lobur
Chapter:
I/o Streams As An Introduction To Objects And Classes
Exercise:
Programming Projects
Question:19 | ISBN:9780321531346 | Edition: 7

Question

Refer to Programming Project 18 for information about the SVG format.

Shown below is another example that illustrates how to draw circles,

ellipses, and multiple lines:

<?xml version="1.0" standalone="no"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"

"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="500" height="500"

xmlns="http://www.w3.org/2000/svg">

<circle cx="100" cy="50" r="30"

stroke="green" stroke-width="3" fill="gold"/>

<ellipse cx="100" cy="200" rx="50" ry="100"

style="fill:purple;stroke:black;stroke-width:2"/>

<polyline points="10,10 40,40 20,100 120,140"

style="fill-opacity:0;stroke:red;stroke-width:2"/>

</svg>

The <circle> tag draws a circle centered at (100, 50) with radius 30 and

pen width of 3. It is filled in with gold and has a border in green.

The <ellipse> tag draws an ellipse centered at (100, 200) with x radius of

30 and y radius of 100. It is filled using purple with a black border.

The <polyline> tag draws a red line from (10, 10) to (40, 40) to (20, 100)

to (120, 140). The fill-opacity is set to 0, making the fill of the polygon

transparent.

Based on these examples and those presented in Project 18, write a program

that creates an SVG image that draws a picture of your professor. It can be

somewhat abstract and simple. If you wish to draw a fancier image, you can

research the SVG picture format; there are additional tags that can draw

using filters, gradients, and polygons.

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Sorry the answer is not available at the moment…

If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.

Spread the 'tradition of sharing'.