Question: Solve using C++ program step by step code and screenshot for the output One can compare the vowels in words of the same length at
Solve using C++ program step by step code and screenshot for the output
One can compare the vowels in words of the same length at the same positions. By using bitwise operations, one can determine if the letters in both words are vowels, or not, or if only one letter was a vowel and the other a consonant. Vowels for this problem are the letters a e i o u. Write a program given two words of equal length, convert the word to a binary number for the AND (&), OR(|), and XOR(^) operators. For example, the words happy and shops: happy shops 00000 = 0 (AND no chars are both vowels) 01100 = 12 (OR 2nd and 3rd chars are vowels) 01100 = 12 (XOR is the same as OR for these words) Input from the keyboard two words of equal length on separate lines. Each word is less than 32 characters and at least 1 character. Assume proper input. Output to the screen the bitwise &, |, and ^ decimal value for each word pair, labeled, on one line separated by a space. Finally, ask the user if he/she wishes to run the program again (check case). Refer to the sample output below. Sample Run: Enter string 1: happy Enter string 2: shops AND: 0 OR: 12 XOR: 12 Run again (Y/N): y Enter string 1: at Enter string 2: in AND: 2 OR: 2 XOR: 0 Run again (Y/N): N
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
