Question: 2. Figures. Create a project titled Lab5_Figures. This project shall contain multiple files. Write a program that repeatedly asks the user to select figure size,

 2. Figures. Create a project titled Lab5_Figures. This project shall contain

2. Figures. Create a project titled Lab5_Figures. This project shall contain multiple files. Write a program that repeatedly asks the user to select figure size, paint character and then the figure. The figures are a square, a slash or a crossed square. For a slash, the program needs to clarify if it is a forward or back slash. For a square, it needs to clarify if it is a filled or hollow square. No clarifying questions need to be asked about the crossed square. Then, the program should print the requested figure. The program should quit if the user inputs an invalid option. See an example dialog below (user input is in bold): select size: 7 select paint character: 1. square 2. slash 3. crossed square select figure: 1 filled, hollow [f/h]:h select size: 3 select paint character: + 1. square 2. slash 3. crossed square You can reuse your code from the Looping Lab. Place figure-printing code in five separate functions: filledSquare (), hollowSquare (), slash(), backslash(), and crossedSquare (). Each function should accept two paramters: an integer size of the figure and the paint character. The function should return no value (be a void-function). Create three separate files figures.cpp, figures.hpp, and figuresinput.cpp. Place the square, slash and crossed square function definitions in figures.cpp and their prototypes in figures. hpp. Make sure that the header file is protected against multiple inclusion. Place the main () function in figures Input.cpp 3. Consider this example. Complete the function sumpositive such that it accepts an array by const-reference and the array size and returns the sum of the positive elements

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!