Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

function Program 10-12 1 1 This program uses a function to copy a c-string into an array. 2 #include 3 using namespace std; s void stringCopy (char [1, char (): // Function prototype 7 int main) const int LENGTH-30: 11 size of the arrays char first[LENGTH ] : char second [ LENGTH]: To hold the copy 10 // To hold the user's input 12 13 14 15 16 17 18 19 20 21 // Get a string from the user and store in first. cout

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_2

Step: 3

blur-text-image_3

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

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

How does an organization know if it is pursuing optimal strategies?

Answered: 1 week ago

Question

7. What traps should she avoid?

Answered: 1 week ago

Question

5. What decision-making model would you advocate to this person?

Answered: 1 week ago

Question

6. What data will she need?

Answered: 1 week ago