Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions