Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program named hw4pr2.cpp to draw a correct Texas flag using rectangles, lines, and/or polygons (not images).To draw a white 5-pointed star, first do

  1. Write a program named hw4pr2.cpp to draw a correct Texas flag

using rectangles, lines, and/or polygons (not images).To draw a white

5-pointed star, first do a little trig to calculate the vertices and then map

those points to window coordinates.Note: The official proportions of the Texas

flag are as follows: each colored panel (red, white, and blue) has dimensions

in the ratio 1 to 2, e.g., the blue panel is twice as tall as it is wide.

2. Write a program to create a bar chart showing the average monthly

mean temperature for College Station from 2004 to 2013.The point of the

exercise is to compute the size and location of the rectangles rather than

explicitly hardcode that information. This means thinking about scale and

offsets.

The data is:

201348.3 degree F

201258.1

201154.5

2010 47.1

2009 51.1

200850.9

200755.5

200655.2

2005 49.5

200456.9

Put it in an initializer list (use vector).

Note that a good graphic will have the bars for each year clearly separated

and a better graphic will have the tick mark for the year aligned with the

center of the bar for that year.

Name your program hw4pr3.cpp.

image text in transcribed 2. Write a program named hw4pr2.cpp to draw a correct Texas flag using rectangles, lines, and/or polygons (not images). To draw a white 5-pointed star, first do a little trig to calculate the vertices and then map those points to window coordinates. Note: The official proportions of the Texas flag are as follows: each colored panel (red, white, and blue) has dimensions in the ratio 1 to 2, e.g., the blue panel is twice as tall as it is wide. 3. Write a program to create a bar chart showing the average monthly mean temperature for College Station from 2004 to 2013. The point of the exercise is to compute the size and location of the rectangles rather than explicitly hardcode that information. This means thinking about scale and offsets. The data is: 2013 48.3 degree F 2012 58.1 2011 54.5 2010 47.1 2009 51.1 2008 50.9 2007 55.5 2006 55.2 2005 49.5 2004 56.9 Put it in an initializer list (use vector). Note that a good graphic will have the bars for each year clearly separated and a better graphic will have the tick mark for the year aligned with the center of the bar for that year. Name your program hw4pr3.cpp. 4. Read a line from the console into a string s using getline and see if it is a palindrome by using two pointers of type char *, e.g., char *left = &s[0]; to pick the characters to compare. Remember that a palindrome is spelled the same way forward and backward. Count upper and lower case letters the same, and ignore any character that is not a letter (e.g., whitespace or punctuation). Name your program hw4pr4.cpp. A sample run should look like this: Enter a word or a sentence: a Toyota That is a palindrome Enter a word or a sentence: Madam, I'm Adam. That is a palindrome Enter a word or a sentence: Won ton? That is a palindrome Not now! Enter a word or a sentence: Scooby dooby doo That is not a palindrome

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

Business And Professional Ethics

Authors: Leonard J Brooks, Paul Dunn

8th Edition

1337514462, 9781337514460

More Books

Students also viewed these Accounting questions

Question

The quality of the argumentation

Answered: 1 week ago