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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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