Answered step by step
Verified Expert Solution
Question
1 Approved Answer
code in c++ Problem A: Random vertical print (20 points) Write a program that asks the user to input some letters to be vertically displayed.
code in c++
Problem A: Random vertical print (20 points) Write a program that asks the user to input some letters to be vertically displayed. Put a zero at the end to signify the end of the letters to be printed (much like the in HW2B). You should skip white space, such as tabs, spaces or enters (see example 21 You should then print the input text vertically on the 10 character index 9 or in the middle) of each row, and the rest of the row should be filled with a random character chosen from 0. T o (space)). There should be a total of 19 characters on each line (including the actual words, so it is in the center). You may assume they user always puts a zero at the end of their desired text. I suggest you break this program up into various parts (ie, functions) To make my code answer to this problem. I made these functions: char randomCharl: Il returns either 0,1 or at random void printLine(char cint spot, int len): /prints a line of random characters of length=en', I except for is always at spor (Hint: Use the buffer and only in a char variable.) (Reminder: this line should be run once and only once in your code): srand(time()); // you may need to say: srand(time(NULL)); Example 1 (user input is underlined): What do you want printed vertically? hela 00 0110 10.00 1101 00 1 0 .111000 0.00 .10011 10001.0 .11 0011 .110.101 .00.1. .00.0 10 11 1000. 1010 111 Example 2 (user input is underdined) What do you want printed vertically? LIKE A BASSO 0..0. .0L 1100 1 0000 1101111 0 100 1.0.KO. 0101 01.1010 IE.000 1.1 - 0000 All 1.1110 0.0 1.30 101 1 00.011 .00.10. 001. 1100 0.0081 110 10 00 .110..S 00011.0 . .011 001-0100 Example 3 (user.input is underlined: What do you want printed vertically? 000.01 0100 0.1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started