Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions