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...
-
a. Each of the statistical graphics presented on the first page of this chapter seems to suggest that information is about what population? Is that the case? Justify your answer. b. Describe the...
-
Determine the force in members CD, CF, and CG and state if these members are in tension or compression. Units Used: kN = 103 N Given: F1 = 2kN F4 = 5kN a = 5 m F2 = 4kN F5 = 3kN b = 2 m F3 = 4kN c =...
-
The following elements of stockholders' equity are adapted from the balance sheet of Volvo Marketing Corp. Volvo paid no preferred dividends in 2008 Requirement Compute the dividends to preferred and...
-
Go-for-Broke Company is being liquidated under Chapter 7 of the bankruptcy code. When it filed for bankruptcy, its balance sheet was as follows: *All accrued wages must be paid out of the liquidation...
-
Graph the circle whose equation is given below. (x+3) + (y + 2) = 6
-
Complete Tsate's Form 1040-SR, Schedules A, B and D, Form 8949, Form 6252 and Qualified Dividends and Capital Gain Tax Worksheet. Tsate Kongia (birthdate 02/14/1954) is an unmarried high school...
-
In a specific wager, Pat is paid $5.00 if the price of ABC Corp. is above $85.00. Currently,ABC Corp. price is $75.00,= 0.25, r = 0.04, div = 0 and the wager lasts 6 months. If the priceis below...
-
Lakeland Manufacturing Company has a patent on a high-pressure hydraulic valve. The valve is a major improvement in high-pressure hydraulic systems, and Lakeland has enjoyed a monopoly position in...
-
The table below illustrates the trend in Non-Performing Loans (%) Sept 2018 20.03 Mar 2018 June 2018 22.58 22.56 Dec 2018 18.19 a. Explain the following banking terminologies related to credit. i....
-
1. Define, in detail, what is the impact of knowledge on creativity? 2. What are some of the downsides (at least three) to geographical clustering? 3. Explain, in detail, the concept of technology...
-
Include all the details and how to solve Solving for i in an Annuity -10,500 2 Present Value Future Value Annual Payment 5 Number of Years Annual Rate 0 1,500 10 Instruction: Suppose that you are...
-
A description of how the new management system will enhance security of the business's data and intellectual property. Briefly discuss any changes that may be required to internal systems and...
-
Solve the system. State whether the system is inconsistent or has infinitely many solutions. If the system has infinitely many solutions, write the solution set with y arbitrary. 8x-32y=0 -3x+12y = 17
-
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
-
Why might a management action to do nothing in response to a new product introduction by a competitor be considered risky?
-
What roles do the external auditor and the internal auditor play in monitoring risks in an organization?
-
What are the major electronic sources of information an auditor can utilize to assess risks associated with an audit client?
Study smarter with the SolutionInn App