Question: Exercise 1. [10 points ] Write a C++ program that prompts user an input string and number of rows, and convert the input string into

 Exercise 1. [10 points ] Write a C++ program that prompts

Exercise 1. [10 points ] Write a C++ program that prompts user an input string and number of rows, and convert the input string into a zigzag form and returns the resulting string read line by line. For example, the string "ELEC230SPRING22" is written in a zigzag pattern on a given number of rows 'four' as follows: ELEC230SPRING22 4 (a) [2 points] Write a C++ function which reads input string and number of rows from the user. (b) [6 points] Write a C++ function that will take an input string and the number of rows as input and returns an output string that will read the zigzag pattern line-by-line. (c) [2 points] Complete the main function in order to produce the requested outputs. See the following results. Zafers-MacBook-Pro:src zafer\$ ./test Input Stream and the number of rows: ELEC230SPRING22 4 Zigzag output Stream: EOGL3SN2E2PI2CR Zafers-MacBook-Pro:src zafer\$ ./test Input Stream and the number of rows: KUISAILABISHIRING 3 Zigzag output Stream: KABIGUSIAIHRNILSI

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!