Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description (It has to work with c++ thank you.) The purpose of this challenge is to manually manipulate character arrays. This challenge translates human to

Description (It has to work with c++ thank you.)

The purpose of this challenge is to manually manipulate character arrays. This challenge translates human to dog.

Requirements

  1. Write a program to translate any entered string into a variation of the word Woof
  2. Ask the user to enter a string use a character array to receive this input. Set your array to hold a string to hold up to 100 characters.
  3. Create a function bool void translate(char human[], char dog[]). The function will take in text via the human parameter and pass the translated text via the dog parameter. Think of the human parameter as the input and the dogparameter as the output
    1. Translate any one-character word as w
    2. Two-character word as wf
    3. Three-character words become wof
    4. Four-character words become woof
    5. 6-character words become woooof
    6. and so on, longer words will have a w as the first character and an f as the last character and however many os to have an equivalent resulting length
    7. Maintain the case as entered by the user. If the user enters Hello this becomes Wooof
    8. Maintain any other characters entered by the user. If the user enters Hello, Charlie! this becomes Wooof, Wooooof!
  4. Ask the user to enter a string. Use cin.getline(char_variable, 100) function call to get the string from the user in main.
  5. Display the translated message

Sample Interaction / Output

 Enter a string: Hello Wooof Enter a string: How are you today? Wof wof wof wooof?

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

More Books

Students also viewed these Databases questions

Question

Answered: 1 week ago

Answered: 1 week ago

Question

6. Conclude with the same strength as in the introduction

Answered: 1 week ago

Question

7. Prepare an effective outline

Answered: 1 week ago