Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Quickly as you can Hijjawi Faculty for Engineering Technology Computer Engineering Department CPE 150: Introduction to Programming Lab Task# 10: Arrays of Char (Strings)

image text in transcribed

Please Quickly as you can

Hijjawi Faculty for Engineering Technology Computer Engineering Department CPE 150: Introduction to Programming Lab Task\# 10: Arrays of Char (Strings) and 2D Array Write a C++ program that has three files: header, implementation, and main files. The header file contains the following functions' prototypes: 1. int stringLength(const char[]) This function receives a string and returns its length. The length of a string is the number of its characters excluding the null character. (You are NOT ALLOWED to use the cstring library.) 2. void upperoddLetters(char []) This function receives a string and convert each letter that position is odd to upper case. Hint: use these functions from the cctype library int toupper (char c) Converts c to its uppercase equivalent if c is a lowercase letter and has an uppercase equivalent. If no such conversion is possible, the value returned is c unchanged. e.g: char upper; upper = toupper(temp); int tolower (char c) Converts c to its lowercase equivalent if c is a lowercase letter and has an uppercase equivalent. If no such conversion is possible, the value returned is c unchanged. 3. void read2DArray (int a[][ cols], const int r, const int c) This function reads the elements of the 2D array from the user. 4. void print2DArray(const int a[][cols], const int r, const intc) This function prints the elements of the 2D array to the screen. 5. void manipulate2DArray(const int a[][ cols ], const int r, const int c, int n ) This function subtract n from each element in the array. - implementation.cpp file contains the definitions for the functions which their prototypes are declared in header.h - In main.cpp: - Define local array of char (string) and give it an initial value. - Define local 2D array of integer of size 33 and give it an initial value. - Test your functions in the main program. A menu-driven program with the following menu could be implemented for this purpose. 1. String Length 2. Reverse String 3. Read 2D Array 4. Print 2D Array 5. Manipulate Array Elements 6. Exit

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

Students also viewed these Databases questions

Question

Describe the five key elements of internal controls (10marks)

Answered: 1 week ago

Question

Explain the Neolithic age compared to the paleolithic age ?

Answered: 1 week ago

Question

What is loss of bone density and strength as ?

Answered: 1 week ago