Question
Description The purpose of this challenge is to manually manipulate character arrays. This challenge translates human to dog. Requirements Write a program to translate any
Description
The purpose of this challenge is to manually manipulate character arrays. This challenge translates human to dog.
Requirements
Write a program to translate any entered string into a variation of the word Woof
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.
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 dog parameter as the output
Translate any one-character word as w
Two-character word as wf
Three-character words become wof
Four-character words become woof
6-character words become woooof
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
Maintain the case as entered by the user. If the user enters Hello this becomes Wooof
Maintain any other characters entered by the user. If the user enters Hello, Charlie! this becomes Wooof, Wooooof!
Ask the user to enter a string. Use cin.getline(char_variable, 100) function call to get the string from the user in main.
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
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