Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use C++ Write a C++ program that creates a 2-D array of characters with size 30 x 40. Initial the whole 2- D array

image text in transcribed

please use C++

Write a C++ program that creates a 2-D array of characters with size 30 x 40. Initial the whole 2- D array with character 'a's. Then program should ask for user input ten times. Each time ask for 3 user input: a row number, a column number, and a character. The program should put the character read from the user into the array at the given row and column position. For example, if user enters 5 9 d, which means put the character 'd' at location row 5 column 9 in the array. If the location is out of the bounds for the 30 x 40 array, display error message. The program should ask for user input 10 times (invalid input does not count) which means 10 user picked characters will be stored in the 2-D array. After the 10 input, print the whole 2-D array by calling the print_array() function. (see the requirement of the print_array() function) Then in the main function, call the find() function and print the location of the target character. Before calling the function, ask user to choose the target character. If the target character is not found, print "not found",otherwise display the location of it. (See the requirement of the find) function.) Write a function, print_array(), to print the array. The 2-D array should be passed to the print array() function. .Write a function called find(). The function takes four parameters: a 2-Dimensional array of characters, the target character and 2 integers. The function must check each element of the array to find the target character which was set by the user. If the element contains the specific character, the function should set the two integer parameters to the x and y position of the character. You may assume the size of the array is defined as global variables named Width and Height

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

2. What are your challenges in the creative process?

Answered: 1 week ago