Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In c++ Figures. Create a project titled Lab5_Figures. This project shall contain multiple files. Write a program that repeatedly asks the user to select either

In c++

Figures. Create a project titled Lab5_Figures. This project shall contain multiple files. Write a program that repeatedly asks the user to select either a square, slash (diagonal line) or backlash (reverse diagonal line) then inputs the figure size and prints the appropriate figure in stars. For square, the program should ask whether the user wants a filled, hollow or slashed square. The program should quit if the user inputs an invalid option. See an example dialog below (user input is in bold):

1. square 2. slash 3. backslash select figure: 1 select size: 7 filled, hollow or slashed [f/h/s]: s ******* ** ** * * * * * * * * * * * ** ** ******* 1. square 2. slash 3. backslash ... 

You can reuse your code from the Looping lab. Place star-printing code in four separate functions: filledSquare(), hollowSquare(), slashedSquare(), slash() and backslash(). Each function should accept a single integer parameter - the size of the figure and return no value (be a void-function). Create three separate files figures.cpp, figures.hpp, and figuresInput.cpp. Place the square and slash 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 figuresInput.cpp

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

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions