Posts

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 (...

fizz buzz game

Image
 #include <iostream> int main(){   //brain ki gaand yha se phategi   for(int i=0 ; i<=100 ; i++){     std::cout<<i<<"\n";      if(i%3==0){     std::cout<<"Fizz\n";}     else if(i%5==0){       std::cout<<"Buzz\n";     }     else if(i%3==0 && i%5==0){       std::cout<<"FizzBuzz\n";     }     else{       std::cout<<i<<"\n";     }   } }

harry potter wing selection

Image
  # include < iostream > int main () { int gryffindor = 0 ; int hufflepuff = 0 ; int ravenclaw = 0 ; int slytherin = 0 ; int answer1, answer2, answer3, answer4; std::cout << " =============== \n " ; std::cout << " The Sorting Hat \n " ; std::cout << " =============== \n\n " ; // ~~~~~~~~~~ Question 1 ~~~~~~~~~~ std::cout << " Q1) When I'm dead, I want people to remember me as: \n\n " ; std::cout << " 1) The Good \n " ; std::cout << " 2) The Great \n " ; std::cout << " 3) The Wise \n " ; std::cout << " 4) The Bold \n\n " ; std::cout << " Enter your answer (1-4): " ; std::cin >> answer1; if (answer1 == 1 ) hufflepuff++; else if (answer1 == 2 ) slytherin++; else if (answer1 == 3 ) ravenclaw++; else if (answer1 == 4 ) gryffindor++; // ~~~~~...