Write a complete C++ program to check whether the string input is similar when it reads...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a complete C++ program to check whether the string input is similar when it reads the same backwards as forwards using queue algorithms based on the instructions given. In the class ADTqueue, write all functions such as empty(), full(), append(...) and serve(). In the main() function: Get input string from user and check the length of the string. Call an append(...) function to add the letter into the queue. Repeat the process until all letter has been stored in the queue. Call a function serve() and store the letter to the new variable string. Repeat the process until the queue is empty. Compare the inputs string. If the strings are the same then display the message "it is same". Repeat this process if user wish to continue. Sample Output: Enter a word [Letter must be in lowercase]: pop pop is same Do you want to continue : Y Enter a word (Letter must be in lowercase]: peter peter is NOT same. Do you want to continue: Y Enter a word [Letter must be in lowercase]: madam madam is same Do you want to continue : Y Enter a word [Letter must be in lowercase]: rotator rotator is same Do you want to continue : Y Enter a word [Letter must be in lowercase]: door door is NOT same Do you want to continue : Y Enter a word [Letter must be in lowercase]: reviver reviver is same Do you want to continue : N Write a complete C++ program to check whether the string input is similar when it reads the same backwards as forwards using queue algorithms based on the instructions given. In the class ADTqueue, write all functions such as empty(), full(), append(...) and serve(). In the main() function: Get input string from user and check the length of the string. Call an append(...) function to add the letter into the queue. Repeat the process until all letter has been stored in the queue. Call a function serve() and store the letter to the new variable string. Repeat the process until the queue is empty. Compare the inputs string. If the strings are the same then display the message "it is same". Repeat this process if user wish to continue. Sample Output: Enter a word [Letter must be in lowercase]: pop pop is same Do you want to continue : Y Enter a word (Letter must be in lowercase]: peter peter is NOT same. Do you want to continue: Y Enter a word [Letter must be in lowercase]: madam madam is same Do you want to continue : Y Enter a word [Letter must be in lowercase]: rotator rotator is same Do you want to continue : Y Enter a word [Letter must be in lowercase]: door door is NOT same Do you want to continue : Y Enter a word [Letter must be in lowercase]: reviver reviver is same Do you want to continue : N
Expert Answer:
Answer rating: 100% (QA)
Heres a complete C program that implements the described functionality using a queue algorithm cpp i... View the full answer
Related Book For
Business Statistics Communicating With Numbers
ISBN: 9780078020551
2nd Edition
Authors: Sanjiv Jaggia, Alison Kelly
Posted Date:
Students also viewed these programming questions
-
In the case of Raymond Weil, S.A. v. Theron , the court finds that the breach with regard to the Montblanc incident - display of a fourteen-foot poster for about 48 hours - was cured. It was cured by...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
93) Clay of the Land is a manufacturer of glazed clay pots. Currently, it produces 300 clay pots per month which it sells through nurseries at a constant price of $5 per pot. Current demand for clay...
-
According to an analysis, a sample of phosphate rock contains 71.2% Ca3(PO4)2, by mass. How many grams of calcium dihydrogen phosphate, Ca(H2PO4)2, can be obtained from 10.0 g of phosphate rock from...
-
What are the pros and cons of a regional organization structure?
-
How does transparency promote ethical behavior?
-
John Wills, Bates & Hill Fabricators' budget director, has received budget information from several managers (see Exercises 5-8, 9, 11, 15, 17, 19, 20, 23, and 25) and is preparing the company's cash...
-
Part a) Find the equation of the tangent line to the curve 3,? TIyE -l- cps 231; = 2 at the point (D, 1]. y = I+ See Example 3 page 132 for a similar example. Find dy/dx if 3x y - 3y = 23 - 2. Solve...
-
A new company is planning to make and sell new cheap smart phones in America. They will sell the phone at $99.99 in a market that potentially buys 1 million smart phones every year. They hope to get...
-
Brooke sells clay pots at his pottery studio for $30 each. The overhead expenses are $11 per pot and operating profit is 30% on selling price. a. What is his amount of markup per pot? b. How much...
-
Explain the roles of the World Bank (WB) in the acceleration of globalization.
-
A. Look at the capital structures of eBay and Google. Can you identify any reasons for the difference? Can you think of any comments or recommendations? Does any of the capital structure theories fit...
-
If Product A and Product B has a prime cost of P100,000 and P200,000. And a conversion cost of P80,000 and P180,000, respectively. What is the total manufacturing cost of Product B?
-
Use the Dividend Growth Model (DDM) to estimate the inherent value of a share of the Red Monkey Corporation, along with the following information; 1. Beta - 1.25 2. Retention Ratio -.60 3. This...
-
A 2.00 kg pendulum bob on a string 1.50 m long, is released with a velocity of 2.00 m/s when the support string makes an angle of 30.0 degrees with the vertical. What is the speed of the bob at the...
-
Los siguientes datos fueron tomados de los registrosde Millet Corporation por 1 punto del ao terminado el 31 dediciembre de 2009: Ventas a cuenta, P7,200,000: Cuentas por cobrarcanceladas, P50,00 1...
-
Complete the following acid-base reactions: (a) HCCH + NaH
-
When obtaining knowledge of a company what type of material can auditors use? What ISA concept discusses this issue? Briefly discuss the standard.
-
(Financial planning) Section 2.5. of this chapter discusses the problem of Linda Joness parents, who wish to save for Lindas college education. The setup of the problem implicitly assumes that the...
-
Why is it important to have discussions with the client about their objectives?
Study smarter with the SolutionInn App