Q2) write a C++ program to generate the following pattern using the functions SpacesOnesLine(S, Ones) and SpacesZerosLine(S, Zeros) to produce each line in the pattern. The functions SpacesOnesL ine(S, Ones), and SpacesZerosLine(S, Zeros) is a 11111 1111 111 value returning function that produce a string consists of S spaces followed by Ones of '1' 11 for the first function or Zeros of 0' for the second function. 1 Ex: str= SpacesOnesLine(3, 2); will produce str=" cout<< SpacesZerosLine(2, 3)< St=" "; Then St-St+'A'; => St=" A"; Then St-St+'A'; => St=" AA"; 11" and 000" 00 000 0000 "e) 00000

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section9.4: Character Manipulation Functions
Problem 5E
icon
Related questions
Question
i need the answer quickly
Q2) write a C++ program to generate the following pattern using the functions
SpacesOnesLine(S, Ones) and SpacesZerosLine(S, Zeros) to produce each line in the
pattern. The functions SpacesOnesLine(S, Ones), and SpacesZerosLine(S, Zeros) is a
11111
1111
111
value returning function that produce a string consists of S spaces followed by Ones of 1'
11
for the first function or Zeros of 0' for the second function.
1
Ex: str= SpacesOnesLine(3, 2); will produce str="
cout<< SpacesZerosLine(2, 3)<<endl: will print the following line :"
Hint: string St=""; St-St+' ; => St=" "; Then St-St+'A'; => St=" A"; Then St-St+'A';
=> St=" AA";
11" and
000"
00
00
0000
re)
00000
Transcribed Image Text:Q2) write a C++ program to generate the following pattern using the functions SpacesOnesLine(S, Ones) and SpacesZerosLine(S, Zeros) to produce each line in the pattern. The functions SpacesOnesLine(S, Ones), and SpacesZerosLine(S, Zeros) is a 11111 1111 111 value returning function that produce a string consists of S spaces followed by Ones of 1' 11 for the first function or Zeros of 0' for the second function. 1 Ex: str= SpacesOnesLine(3, 2); will produce str=" cout<< SpacesZerosLine(2, 3)<<endl: will print the following line :" Hint: string St=""; St-St+' ; => St=" "; Then St-St+'A'; => St=" A"; Then St-St+'A'; => St=" AA"; 11" and 000" 00 00 0000 re) 00000
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning