Question: C++ Lab Create a program that shows various c-string manipulation techniques. This lab should be implemented as a menu driven program that calls various functions

C++ Lab

Create a program that shows various c-string manipulation techniques. This lab should be implemented as a menu driven program that calls various functions that demonstrate your understanding of character arrays, c-strings and the string class.

In main() create a menu with 5 options:

1.Doing Math with Strings

2.Counting Elements

3.C-String Manipulation

4.String Class Manipulation

5.Exit Program

Loop though the menu until the user selects to exit the program. You may use numbers or letters to indicate the menu options. Test that the user enters in a valid option. If they do not enter a valid option, tell the user their selection is invalid and allow them to reenter the option. The menu will continue to loop until a valid option is entered.

Write a function named scStringManip that demonstrates the following concepts (NOTE: scString variables should be declared as strings not character arrays):

Enter in two strings part numbers for a car. Compare and sort the strings (ask for 2 words; if they are equal, state that they are the same; if not equal then alphabetize and display the two words in alphabetical order).

Enter in two strings representing a car make and model. Append the second string to the first string using += (appending). Display the final string.

Enter in two strings representing a car dealer and a city. Concatenate the second string to the first string using + (concatenating). Display the final string. Dont forget to add a space between the first and last name.

Write a function called ExitProgram that returns a Boolean value. The function confirms if the user wishes to exit the program. The only acceptable answers are Y and N (use toupper() to allow y and n). Exit the program if the user selects to do so.

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!