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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started