Vector Functions C++

Aliens really like to eat C++ vectors that contain integers. For this lab I would like you to write a function called `tastesGood` that takes an integer vector and returns `true` if it tastes good and `false` otherwise. The prototype for this function is listed below:

``````bool tastesGood(const vector<int>& v);
``````

To complete part 1, your function should return `true` if the vector starts and ends with the same integer. It is safe for you to assume that the vector will have at least two integers.

Don't use plagiarized sources. Get Your Custom Essay on
Vector Functions C++
Just from \$10/Page

For example:

``````vector<int> v;
v.push_back(1);
v.push_back(3);
v.push_back(5);
v.push_back(1);
bool b = tastesGood(v);

tastesGood should return true here because the vector starts and ends with 1.``````

To complete part 2, your function should return `true` if the size of the vector is greater than five.

For example:

``````vector<int> v;
v.push_back(1);
v.push_back(3);
v.push_back(5);
v.push_back(1);
v.push_back(8);
v.push_back(7);
bool b = tastesGood(v);

tastesGood should return true here because the size of the vector is larger than five.
``````

To complete part 3, your function should return `true` if the vector contains more even numbers.than odd numbers.

For example:

``````vector<int> v;
v.push_back(2);
v.push_back(4);
v.push_back(5);
v.push_back(1);
v.push_back(8);
bool b = tastesGood(v);

tastesGood should return true here because the the vector has more even numbers than odd ones.
``````

The prototype for your function should be placed in a file called `functions.h` and the function implementation should be placed in a file called `functions.cpp`.

Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool’s honor code & terms of service.

Get professional assignment help cheaply

Are you busy and do not have time to handle your assignment? Are you scared that your paper will not make the grade? Do you have responsibilities that may hinder you from turning in your assignment on time? Are you tired and can barely handle your assignment? Are your grades inconsistent?

Whichever your reason may is, it is valid! You can get professional academic help from our service at affordable rates. We have a team of professional academic writers who can handle all your assignments.

Our essay writers are graduates with diplomas, bachelor, masters, Ph.D., and doctorate degrees in various subjects. The minimum requirement to be an essay writer with our essay writing service is to have a college diploma. When assigning your order, we match the paper subject with the area of specialization of the writer.

Why choose our academic writing service?

• Plagiarism free papers
• Timely delivery
• Skilled, Experienced Native English Writers
• Subject-relevant academic writer
• Adherence to paper instructions
• Ability to tackle bulk assignments
• Reasonable prices
• 24/7 Customer Support
• Get superb grades consistently

Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

We value our customers and so we ensure that what we do is 100% original..
With us you are guaranteed of quality work done by our qualified experts.Your information and everything that you do with us is kept completely confidential.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Zero-plagiarism guarantee

The Product ordered is guaranteed to be original. Orders are checked by the most advanced anti-plagiarism software in the market to assure that the Product is 100% original. The Company has a zero tolerance policy for plagiarism.

Free-revision policy

The Free Revision policy is a courtesy service that the Company provides to help ensure Customer’s total satisfaction with the completed Order. To receive free revision the Company requires that the Customer provide the request within fourteen (14) days from the first completion date and within a period of thirty (30) days for dissertations.

The Company is committed to protect the privacy of the Customer and it will never resell or share any of Customer’s personal information, including credit card data, with any third party. All the online transactions are processed through the secure and reliable online payment systems.

Fair-cooperation guarantee

By placing an order with us, you agree to the service we provide. We will endear to do all that it takes to deliver a comprehensive paper as per your requirements. We also count on your cooperation to ensure that we deliver on this mandate.

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors: