Problem Solving with C++ (9th Edition)
Problem Solving with C++ (9th Edition)
9th Edition
ISBN: 9780133591743
Author: Walter Savitch
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 6, Problem 11PP

Chapter 6, Problem 11PP, To complete this problem you must have a computer that is capable of viewing Scalable <x-custom-btb-me data-me-id='1725' class='microExplainerHighlight'>Vector</x-custom-btb-me> , example  1

To complete this problem you must have a computer that is capable of viewing Scalable Vector Graphics (SVG) files. Your Web browser may already be able to view these files. To test to see if your browser can display SVG files, type in the rectline.svg file below and see if you can open it in your Web browser. If your Web browser cannot view the file, then you can search on the Web and download a free SVG viewer.

The graphics screen to draw an image uses a coordinate system in which (0, 0) is located in the upper-left corner. The x coordinate increases to the right, and the y coordinate increases to the bottom. Consequently, coordinate (100, 0) would be located 100 pixels directly toward the right from the upper-left corner, and coordinate (0, 100) would be located 100 pixels directly toward the bottom from the upper-left corner. This is illustrated in the figure below.

Chapter 6, Problem 11PP, To complete this problem you must have a computer that is capable of viewing Scalable Vector , example  2

The SVG format defines a graphics image using XML. The specification for the image is stored in a text file and can be displayed by an SVG viewer. Here is a sample SVG file that draws two rectangles and a line. To view it, save it to a text file with the “.svg” extension, such as rectline.svg, and open it with your SVG viewer.

<?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">

<rect x="20" y="20" width="50" height="250"

style="fill:blue;"/>

<rect x="75" y="100" width="150" height="50"

style="fill:rgb(0,255,0);"/>

<line x1="0" y1="0" x2="300" y2="300"

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

</svg>

For purposes of this problem, you can ignore the first five lines and the last line and consider them “boilerplate” that must be inserted to properly create the image.

The lines that begins with <rect x="20"…draw a blue rectangle whose upper-left corner is at coordinate (20, 20) and whose width is 50 pixels and height is 250 pixels.

The lines that begin with <rect x="75"…draw a green rectangle (RGB color value of 0,255,0 is all green) whose upper-left corner is at coordinate (75, 100) and whose width is 150 pixels and height is 50 pixels.

Finally, the <line> tag draws a purple line from (0, 0) to (300, 300) with a width of 2.

Based on this example, write a program that inputs four nonnegative integer values and creates the SVG file that displays a simple bar chart that depicts the integer values. Your program should scale the values so they are always drawn with a maximum height of 400 pixels. For example, if your input values to graph were 20, 40, 60, and 120, you might generate a SVG file that would display as follows:

Chapter 6, Problem 11PP, To complete this problem you must have a computer that is capable of viewing Scalable Vector , example  3

Blurred answer
Students have asked these similar questions
Q 1. Create an OpenGL project, name it GLprojectl where you: Define a 600x500 render (drawing) window In the render window, define a coordinate system (-300, 300, -300, 300) Draw the following points and the line segments between them, select a different color for every pair of points and their line segment: а. Р1-(-40, -140), Р2- (100,200) b. P1=(10,270), P2= (200,0) с. Р1- (20,10), Р2- (20,-200) d. P13(0, 0), P2= (250,250)
Design and implement a calculator using HTML, CSS (with Bootstrap) and JavaScript. The calculator will only run in the browser, and must not depend on any server side scripting (C#). Functional requirements: -A display that shows entry and results -Number buttons on the calculator -Supports resetting the calculator (C function) -Supports clearing the current entry (CE function) -Handles user errors (e.g. pressing "5++5" leads to "5+5", pressing "5+-5 leads to "5-5") -Supports using the result in the next calculation Each element of the calculator needs to be labeled with the following HTML id attribute: Display: display Each number button must have the following IDs: 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine' + button: 'plus' - button: 'minus' * button: 'multiply' / button: 'divide' = button: 'equals' C button: 'reset' CE button: 'clear' IDs are used to find buttons on the page, correctly labeling HTML elements with IDs is important for the tests to…
When developing a display driver what would you see the differences in comparison to these two implementations below? Explain to me what would be the benefits of pros and cons, when designing a driver to allow users to get our current frame buffer from our display driver.Explain to me pros and cons of the following options below.Option #1SSD1331 display1;auto& framebuffer = Display<display1>::CurrentFramebuffer();Option #2auto& framebuffer display1.CurrentFramebuffer();

Chapter 6 Solutions

Problem Solving with C++ (9th Edition)

Ch. 6.1 - Prob. 11STECh. 6.2 - Prob. 12STECh. 6.2 - Prob. 13STECh. 6.2 - Prob. 14STECh. 6.2 - What output will be sent to the stuff.dat when the...Ch. 6.2 - Prob. 16STECh. 6.2 - In formatting output, the following flag constants...Ch. 6.2 - Here is a code segment that reads input from...Ch. 6.2 - Prob. 19STECh. 6.2 - Write the definition for a void function called...Ch. 6.2 - (This exercise is for those who have studied the...Ch. 6.3 - Suppose c is a variable of type char. What is the...Ch. 6.3 - Suppose c is a variable of type char. What is the...Ch. 6.3 - Prob. 24STECh. 6.3 - Consider the following code (and assume that it is...Ch. 6.3 - Consider the following code (and assume that it is...Ch. 6.3 - Suppose that the program described in Self-Test...Ch. 6.3 - Consider the following code (and assume that it is...Ch. 6.3 - Prob. 29STECh. 6.3 - Define a function called copyLine that takes one...Ch. 6.3 - Prob. 31STECh. 6.3 - (This exercise is for those who have studied the...Ch. 6.3 - (This exercise is for those who have studied the...Ch. 6.3 - Suppose ins is a file input stream that has been...Ch. 6.3 - Write the definition for a void function called...Ch. 6.3 - Consider the following code (and assume that it is...Ch. 6.3 - Write some C++ code that will read a line of text...Ch. 6 - Write a program that will search a file of numbers...Ch. 6 - Write a program that takes its input from a file...Ch. 6 - a. Compute the median of a data file. The median...Ch. 6 - Write a program that takes its input from a file...Ch. 6 - Write a program that gives and takes advice on...Ch. 6 - Write a program that reads text from one file and...Ch. 6 - Prob. 7PCh. 6 - Write a program to generate personalized junk...Ch. 6 - Write a program to compute numeric grades for a...Ch. 6 - Enhance the program you wrote for Programming...Ch. 6 - Prob. 4PPCh. 6 - Write a program that will correct a C++ program...Ch. 6 - Write a program that allows the user to type in...Ch. 6 - This project is the same as Programming Project 6,...Ch. 6 - This program numbers the lines found in a text...Ch. 6 - Write a program that computes all of the following...Ch. 6 - The text file babynames2012.txt, which is included...Ch. 6 - To complete this problem you must have a computer...Ch. 6 - Write a program that prompts the user to input the...Ch. 6 - The following is an old word puzzle: Name a common...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning
Memory Management Tutorial in Java | Java Stack vs Heap | Java Training | Edureka; Author: edureka!;https://www.youtube.com/watch?v=fM8yj93X80s;License: Standard YouTube License, CC-BY