Posts

Showing posts from November, 2020

WHALE TALK

  Whale Talk Takes a phrase like  "turpentine and turtles"  and translate it into its “whale talk” equivalent,  "uueeieeauuee" . There are a few simple rules for translating text to whale language: There are no consonants. Only vowels excluding the letter y. The  u ‘s and  e ‘s are extra long, so we must double them. Once we have converted text to the whale language, the result is sung slowly, as is custom in the ocean. Write a  whale.cpp  program that accomplishes this translation using loops and vectors. Let’s get started! # include < iostream > # include < vector > # include < string > int main () { std::string input = " Turpentine and turtles. " ; std::vector< char > vowels; vowels. push_back ( ' a ' ); vowels. push_back ( ' e ' ); vowels. push_back ( ' i ' ); vowels. push_back ( ' o ' ); vowels. push_back ( ' u ' ); std::vector< char > whale_talk; for (...