Write your program general enough to handle it

Assignment Help Other Subject
Reference no: EM13316227

A word palindrome reads the same backwards as forwards, if you take the unit to be a word. For example, "so PATIENT A DOCTOR TO DOCTOR A PATIENT SO." In this assignment use a vector of strings. Read words from a file until you come to the end of a line. Store each word as one of the elements of a vector. Thus in the example, from the first line of the file, you would store in the vector's [0] position the string so and in the vector's [1] position the string PATIENT and in the vector's [2] position the string A and in the vector's [3] position the string DOCTOR and so forth. Do not declare the vector with the number of positions to be reserved at the outset. Instead use push_back and later .size() to find out how many positions were needed.

Then have your program call a function into which you pass the vector and its size, and have the function determine if you have a word palindrome. Pass back to the main program a bool variable that is true if you do have a word palindrome, and false if you don't. Then in the main program, print out the line of words and a statement saying whether it is a word palindrome.

To make the task a little easier, the words in the file are all in capitals, but each line does contain punctuation. Do not change what is in the file. Instead, write your program general enough to handle it.

SO PATIENT A DOCTOR TO DOCTOR A PATIENT SO.
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.
YOU CAN CAGE A SWALLOW, CAN'T YOU, BUT YOU CAN'T SWALLOW A CAGE, CAN YOU? BORES ARE PEOPLE THAT SAY THAT PEOPLE ARE BORES.
EARLY TO BED AND EARLY TO RISE MAKES A MAN HEALTHY, WEALTHY, AND WISE. BEAUTY IS AS BEAUTY DOES.
DOES MILK MACHINERY MILK DOES?
GOD KNOWS MAN. WHAT IS DOUBTFUL IS WHAT MAN KNOWS GOD.
LEATHERY SKIN IS SKIN LEATHER.
HIDE! HIDE! THE COW'S OUTSIDE!
YOU HUNT WOLVES; WOLVES HUNT YOU

Reference no: EM13316227

Questions Cloud

Find maximum thickness t of the strip at allowable stress : A 900-mm strip of steel is bent into a full circle by two couples applied. Determine (a) the maximum thickness t of the strip if the allowable stress of the steel is 420 MPa, (b) the corresponding moment M of the couples.
Round your cost per equivalent unit amounts to two decimal : Zither Co. manufactures a product called Zens in a three-process series. All materials are introduced at the beginning of the first process. Zither uses the first-in, first-out method of inventory costing. Unit and cost data for the first process (De..
Determine the force arm oa exerts on the smooth cylinder : If arm OA rotates with a constant clockwise angular velocity of theta dot(first dirivatie)=1.5 rad/s. determine the force arm OA exerts on the smooth 4-lb cylinder B when theta=45 degrees.
How much charge has passed through this circuit : A 10-A current flows for two minutes. How much charge has passed through this circuit
Write your program general enough to handle it : To make the task a little easier, the words in the file are all in capitals, but each line does contain punctuation. Do not change what is in the file. Instead, write your program general enough to handle it.
Find how far the ball drops : A pitcher throws horizontally a fast ball at 146 km/h toward home plate, which is 18 m away. find how far the ball drops because of gravity by the time it reaches home plate
Find the change in depth and in absolute water level produce : Find the change in depth and in absolute water level produced by a) a smooth upward step of 1 ft b) a smooth donward step of 1 ft, in the channel bed c) find the maximum allowable size of thw upstream flow to be a possible as specified
A.lessons from the motor vehicle industry : A.Lessons from the Motor Vehicle Industry
Sales to earn expected profit on proposed investment : From the books of Aggarwal Bors, the following information have been extracted: Rs. Sales 2,40,000 Variable costs 1,44,000 Fixed costs 26,000 Profit before tax 70,000 Rate of tax 40% The firm is proposing to buy a new plant which can generate additio..

Reviews

Write a Review

Other Subject Questions & Answers

  How many drives should be carried as safety stock

Based on available information, lead time demand for CD-ROM drives averages 250 units (normally distributed), with a standard deviation of 25 drives. Management want s a 98% service level.

  Building mobile applications

What management, organization, and technology issues need to be addressed when building mobile applications? How does user requirement definition for mobile applications differ from that in traditional systems analysis?

  Productive ways students can spend their free time.

I am in 10th grade, I am homeschooled, and im writing a 750 word essay. my topic is: "Productive ways students can spend their free time."

  Identify alternative global risk management strategies

you will analyze the potential risk for EDUS in the acquisition of the institution. Further, you will identify alternative global risk management strategies that can reduce the risks associated with this acquisition. Examine the risks of competitors.

  What was nationalism in music during the nineteenth century

What was Nationalism in music during the nineteenth century? List at least four Nationalist composers and a piece they were known for composing.

  What impact did the vietnam war have on laos

What impact did the Vietnam war have on Laos? How are these impacts still felt by the population today?

  Photodynamic therapy

You are an independent consultant, and you have been approached by a company called Gerusa. Gerusa is a company of former Soviet scientists who have developed a method of killing cancer cells with light in a process called Photodynamic Therapy (PDT).

  Upper-class southern women in the antebellum south

In general, upper-class southern women in the antebellum South. What principle did the First Congress establish regulating the president's powers of hiring and firing the heads of the federal government's executive departments?

  Brain structures and functions

Examine the brain structures and functions associated with the motivation to engage in your selected behavior.

  Discuss the role of dietary carbohydrates in a healthy diet

Discuss the role of dietary carbohydrates in a healthy diet. What is the recommended intake range for this macronutrient? What do the dietary guidelines and the USDA food guide pyramid have in common in relation to carbohydrates?

  How do women''s and men''s occupational expectations differ

Discuss how do women's and men's occupational expectations differ? How are people viewed when they enter occupations that are not traditional for their gender?

  Risk responsibility in project environment

Risk responsibility in the project environment can best be described as?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd