Write a C++ program in which, read three c-string str from File. Now take input pat...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C++ program in which, read three c-string str from File. Now take input pat and rpat from user. Now your task is to find pat in str, replace pat with rpat in str if pat is found else display a message pat not found. EECE Example 1 Input: Str: abcdefabcdkuiyh Example 3 Input: Str: abcdefabcdkuiyh Example 2 Example 4 Input: Str: abcdefabcdkuiyh Input: Str: abcdefabcdkuiyh Pat: abcdefg Pat: abcd Pat: ab Pat: abc Rpat: xyz Output: After replace: Str: xyzefxyzkuiyh Rpat: xyz Output: After replace: Str: xyzcdefxyzcdkuiyh Rpat: xyz Output: After replace: Str: xyzdefxyzdkuiyh Rpat: xyz Output: Pat not found Str: abcdefabcdkuiyh Write a C++ program in which, read three c-string str from File. Now take input pat and rpat from user. Now your task is to find pat in str, replace pat with rpat in str if pat is found else display a message pat not found. EECE Example 1 Input: Str: abcdefabcdkuiyh Example 3 Input: Str: abcdefabcdkuiyh Example 2 Example 4 Input: Str: abcdefabcdkuiyh Input: Str: abcdefabcdkuiyh Pat: abcdefg Pat: abcd Pat: ab Pat: abc Rpat: xyz Output: After replace: Str: xyzefxyzkuiyh Rpat: xyz Output: After replace: Str: xyzcdefxyzcdkuiyh Rpat: xyz Output: After replace: Str: xyzdefxyzdkuiyh Rpat: xyz Output: Pat not found Str: abcdefabcdkuiyh
Expert Answer:
Answer rating: 100% (QA)
include using namespace std int main string strstr1... View the full answer
Related Book For
Organic Chemistry
ISBN: 978-1118133576
11th edition
Authors: Graham Solomons, Craig Fryhle, Scott Snyder
Posted Date:
Students also viewed these programming questions
-
Your task is to prepare styrene by one of the following reactions. Which reaction would you choose to give the better yield of styrene? Explain your answer. (1) Styrene Or (2) Styrene Br KOH EtOH, ...
-
Your task is to prepare isopropyl methyl ether by one of the following reactions. Which reaction would give the better yield? Explain your answer. (1) Isopropyl methyl ether Or (2) Isopropyl methyl...
-
Your task is to apply appropriate differences analysis using the surveys desirability measures in your GlobalMotors.sav SPSS dataset to determine the target market descriptions for each of the five...
-
Download a copy of the ACFE Compensation Guide for Anti-fraud Professionals, which is available at no charge at: www.acfe.com/documents/2008-comp-guide.pdf. Based on this resource, answer the...
-
Often it is difficult to distinguish between the probability of anointer section of outcomes (joint probability) and the probability of a conditional outcome (conditional probability). Classify the...
-
The average number of annual trips per family to amusement parks in the United States is Poisson distributed, with a mean of 0.6 trips per year.What is the probability of randomly selecting an...
-
When the plaintiff was 16, he was employed by Kmart as a cashier. At the end of his training, he was required to read Kmarts policy agreement, which included an agreement to submit all employment...
-
One of PLE's manufacturing facilities produces metal engine housings from sheet metal for both mowers and tractors. Production of each product consists of five steps: stamping, drilling, assembly,...
-
Establishing the Value of Life a. Explain how the value of life can be estimated by comparing wage differentials across different occupations or jobs. b. What might be the problem with a calculation...
-
Below is the Trial balance of Miss Piggy & Kermit Inc. after his first years trading: Miss Piggy & Kermit Inc Trial Balance as of 30 June 20X8 Dr. Cr $ $ Revenue 99,082 Purchases 71,409 Rent...
-
Pharoah Clinic purchases land for $ 490000 cash. The clinic assumes $ 5300 in property taxes due on the land. The title and attorney fees totaled $ 2600 . The clinic had the land graded for $ 6400 ....
-
In the last elections, your favorite candidate won the vote with a majority of 2070 votes over all his opponents. His team calculated that this majority represented 4.5% of the votes cast, that is to...
-
You want to be sure to consider how consumers would make a decision to join The Last 5 Pounds (described above). Demonstrate your understanding of the consumer decision-making process by elaborating...
-
What social welfare programs are important resources for a woman's shelter? How do the programs impact the clients/consumers at the women's shelter? Describe specific social welfare policies (like...
-
Recall that one of the Sampsons' goals is to invest for their children's future college education. They are considering investing in several stocks that are rated highly by analysts. Offer advice to...
-
If an insitution says that the interest rate is r% compounded monthly, we say that r% is the nominal rate of interest. The effective rate is the rate that earns the equivalent amount at the end of...
-
Task 1: Create the board Implement a function named create board (NUM ROWS, NUM_COLS) which creates a 5x10 board (ie. 5 rows and 10 columns) for the basic game but user should be able to input any...
-
Solve for the equilibria of the following discrete-time dynamical systems Pr pt+1 = Pr+2.0(I-Pr)
-
Listed below are several hypothetical nucleophilic substitution reactions. None is synthetically useful because the product indicated is not formed at an appreciable rate. In each case provide an...
-
(a) Write the two conformations of cis-1-tert-butyl-2-methylcyclohexane. (b) Which conformer has the lowest potential energy?
-
Synthesize the following compound starting with ethyne and 1-bromopentane as your only organic reagents (except for solvents) and using any needed inorganic compounds. Br Br
-
Who was Phar-Mors flamboyant Chief Executive Officer?
-
Which of the following generally is not considered something of value? 1. Cash, money or checks 2. Airline miles or hotel credits associated with frequent activity (e.g., frequent flier miles) 3. An...
-
Can you create a graphic that highlights each incidence where Fairmont was not in compliance with company policy that requires explicit approval of all hours of eighty hours or more?
Study smarter with the SolutionInn App