Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help completing this code! please help! 5.5 Lab 30: Square of Characters Write a program to build a square of characters. The character making

need help completing this code! please help!

image text in transcribed

image text in transcribed

5.5 Lab 30: Square of Characters Write a program to build a square of characters. The character making up the square and the size of the square is to be determined by the input. Use a FOR loop to build your square. For example, if % and 5 are input, then your program should build a square of % characters that consists of 5 rows and 5 columns Hints 1. Use a char datatype for the variable that holds the character. You can then use the variable as an argument to setfilio 2. Use an int datatype for the variable that holds the size of your square. You can then use the variable as an argument for setw() 3. Each iteration of your FOR loop will output a row of characters. When the input is as shown in Figure 1, your program should produce the output as shown in Figure 2. Figure 1: (input) Figure 2 (output) @@@@@@@ @@@@@@ @@@@@@@ era a cele @ @ @ @ @ @ @ @@@@@@ 1 / Ryan Dewey 2 V/ CS 1336. DMI 37 Lab 3e 4 5 #include 6 using namespace std; 7 int main() 8 { 9 char symbol; 10 int numRows: 12 I read in the charcater and the value that will determine the loop 13 cin.get(symbol); 14 cin >> numRows: 15 16 Hwrite a loop that will repeat numRows times 17 for() 18

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

Were members encouraged to participate?

Answered: 1 week ago