Question: Complete this in C++ code You will be writing a Pirate Speech translator, a program which will convert any given text into pirate speech. Although
Complete this in C++ code
You will be writing a Pirate Speech translator, a program which will convert any given text into pirate speech. Although real pirate speech is complicated, we will follow a set of simple rules for this translator. Your program should ask for input text, and then print out the results text.
Simple Rules
Below you will find certain English words and their Pirate equivalents. Whenever one of these English words appears in the text, replace it with the Pirate equivalent.
English
Pirate
Hello
Ahoy
Whoa
Avast
Yes
Aye
My friend
Me hearty
Quickly
Smartly
Ocean
Briny deep
My drink
Me grog
You
Ye
Bring
Fetch
In addition to these simple replacements, if a sentence ends with an exclamation (!), the next sentence should start with Arr, .
To start, you can output entirely in lowercase. As a challenge, preserve the original capitalization. You will not lose points for all-lowercase output.
Examples
Original: Hello there, my friend, how are you?
Translation: Ahoy there, me hearty, how are ye?
Original: Whoa, you should get in the ocean quickly!
Translation: Avast, ye should get in the briny deep smartly!
Original: Bring me my drink.
Translation: Fetch me me grog.
Original: Hello there! The ocean is fierce today!
Translation: Ahoy there! Arr, the briny deep is fierce today!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
