Chapter 6 problem 42 Require the upper half of the figure to be one of the same
ID: 3619120 • Letter: C
Question
Chapter 6 problem 42
Require the upper half of the figure to be one of the same shapes as are allowed in problem 40, with two copies of the figure ( one upside down) used to create the whole
figure. Problem 42 has a height twice the height of problem 42. Chapter 6 problem 40 is not assignmed, but may be used in creasting a solution for problem 42.
problem 40.
Write a functiont hat creates the following pattern, given the height (number of rows):
*
***
*****
*******
*********
***********
Problem 42.
Write a function that creates the following pattern, given the height (number of rows).
*
***
*****
*******
*********
*********
*******
*****
***
*
Width = 1+ N*(height - 1) where N is the number of asterisks added for the next row.
Note that the above formula for N is for the single triangle in problem 40.
In the example in the book the values N is 2. With other width and height values, the value may bot be 2.
Provide a user interface that enforces this requirement. If the value of N is not an integral value, give the user an error message.
Make the user interface user friendly.