Question
We are going to do one program using C-strings. Use basic C-String (header) only. Nothing fancy. But before we get started - a reminder: All
We are going to do one program using C-strings. Use basic C-String (header) only. Nothing fancy.
But before we get started - a reminder: All your programs need to be of modular design. Use functions appropriately
Please design and then code the following menu-driven program.
The Name Game:
1. Input Full Name
2. Display Name
3. Change my Name to all Lower Case.
4. Count and display the number of words in name
5. Reverse the Name
6. Display Most Frequent Character
7. Exit Menu
Programming Rules:
Declare a character array in main. Use a separate function for each menu item. Pass the name around to each function. Use the C-string functions to manipulate the name.
Validate Input Full Name for not empty.
Keep offering the menu until they choose quit.
Appropriate use of functions required - no global variables - good programming style throughout.
Use Programs 10-12, 10-13 and 10-14 as examples.
Example:
1. Input Full Name: Billie Alice Williams
2. Display Name: Billie Alice Wiliams
3. Change to Lower: Your name has been converted to lower case.
2. Display Name: billie alice williams
4. Count: There are 3 words in your name.
5. Reverse Name: Your name has been reversed.
2. Display Name: smailliw ecila eillib
6. Most Letters: The most used letter in your name is l
7. Exit: Thank you for playing the game.
function Program 10-12 1 1 This program uses a function to copy a c-string into an array. 2 #includeStep 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