lease complete the following function printBox, which accepts three parameters (i.e., char c, int length, int width), and must print a box (using the char c received) of length by width.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section9.5: Input Data Validation
Problem 8E
icon
Related questions
Question

Please complete the following function printBox, which accepts three parameters (i.e., char c, int length, int width), and must print a box (using the char c received) of length by width.

**This is all i have so far. AREAS WITH "?????" are where I need help. Thank you!**

For example,  the output of       printBox('&', 4, 6) ;  

will be as follows:

&&&&&&

&&&&&&

&&&&&&

&&&&&&

 

void printBox(char c, int length, int width)

// parameter 1: char c      ( '&' for example) the char for the box

// parameter 2: int length  ( 4 for example) like # of rows

// parameter 3: int width   ( 6 for example) like # of columns

// Example:     c = '&' ; length = 4 ; width = 6 ;

{ // begin printBox( )

  ?????Need help right here

    

} // end printBox( )

void main( ) // To test function printBox( )

{  printBox( '&', 4 , 6 ) ;  

} // end main( )

 

The output of the above program should be as follows:

&&&&&&

&&&&&&

&&&&&&

&&&&&&

 

View keyboard shortcuts
 
EditViewInsertFormatToolsTable
12pt
 
Paragraph
 
 
 
 
 
 
 
 
 
 
 
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Types of Function
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr