Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C + + program that does the following: a . Create a C + + file with the name lab 1 3 _
Write a C program that does the following:
a Create a C file with the name labcpp
b Write the function fillCharArray which has a twodimensional character array and two integers as
parameters filling each element of the array parameter with a randomly chosen lower case letter.
c Write the function randomChar which has no parameters returning a randomly generated lower case
character. Randomly generate an integer from the range of to and cast it as a char to obtain the
random lower case letter.
d Write the function printArray which has a twodimensional character array and two integers as
parameters printing the elements of the character array parameter separated by spaces, with each row
printed on a separate line.
e Write the function vowelsPerRow which has a twodimensional character array, a onedimensional
integer array and two integers as parameters counting the number of vowels in each row of the character
array. The count for row i is stored in element i of the integer array.
f Write the function vowelsPerCol which has a twodimensional character array, a onedimensional integer
array and two integers as parameters counting the number of vowels in each column of the character array.
The count for column i is stored in element i of the integer array.
g Write the function printVowelRows which has a onedimensional integer array and an integer as
parameters printing the vowel count for rows with a positive count.
h Write the function printVowelCols which has a onedimensional integer array and an integer as
parameters printing the vowel count for columns with a positive count.
i Write the main function that does the following:
i Declare a x character array.
ii Declare an integer array of size
iii. Declare an integer array of size
iv Call the srand function to seed the random number generator using time
v Call the function fillCharArray passing into it the character array, and
vi Call the function printArray passing into it the character array, and
vii. Call the function vowelsPerRow passing into it the character array, the integer array of size
and
viii. Call the function vowelsPerCol passing into it the character array, the integer array of size
and
ix Call the function printVowelRows passing into it the integer array of size and
x Call the function printVowelCols passing into it the integer array of size and
Sample run of the program:
v j x l
v e n u
Row contains at least one vowel.
Col contains at least one vowel.
Col contains at least one vowel.
Step 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