Question: Write a c++ program that reads in a cstring, copy its content to a character array name myArray, it then replace all the consecutively occurring

Write a c++ program that reads in a cstring, copy its content to a character array name myArray, it then replace all the consecutively occurring alphabets/characters from it with B at those indexes. After this replacement, your program must convert back your array to string and check if it is palindrome or not. (Palindrome is a string that appears same if read from from or back e.g. MOM, MADAM, LEVEL etc.) myString1: MyaaJkggY myString2: GojhhggjoG myArray1: MyBJkBY myArray2: GojBBjoG Output1: Not palindrome Output2: Palindrome

Write a function named MyEmoji which reads a file named MyFile.txt (read it in form of cstring) and calculate number of emojis in the file. An emoji is a combination of three specific characters together such as :-) , :-( , :-/ and :-D . You are required to write a c++ program that reads a whole file, traverse its strings and calculate number of emojis found in it. For Example File Content: My name is Danish :-) Zain is my friend :-D Mahnoor is very good :-) Talha has to go home :-/. We pray this is postLab :-D But unfortunately, this is InLab :-( Output: Number of emojis are 6.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!