Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 3 [20 points] A palindrome is a sequence of characters which reads the same backward or forward. Examples: rotor, Rotor (with capital R), step

image text in transcribed
Exercise 3 [20 points] A palindrome is a sequence of characters which reads the same backward or forward. Examples: "rotor", "Rotor" (with capital R), "step on no pets", ete Write the code for the following functions: // returns true if s is a palindrome and false otherwise bool is_palidrome(string s); // returns the number of palindromes in vector v of strings int countPalindromes(const vectorcstring& v) Exercise 4120 points] . Write a declaration for a structure named Inventoryltem that holds the following data: inventory item ID or code, inventory item description, and item availability (i.e. number of available items). For example, if printer cables are part of your inventory, you will hold the following data: 120 (inventory item ID). "Printer Cable" (inventory item description), and 235 (number of printer cables available). Write the following function whose prototype is given below: // nicely prints the data held in item one piece of data per line void display[Inventoryltem item); Exercise 5 [40 points] Consider the following class Inventoryltem class Inventoryltem public: // constructor Inventoryltem(): ID(O),_descriptionl"no name"), _onHand(0) D // get functions int getltemID() const; string getitemDescription() const int getltemAvailability) const

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago

Question

13-1 How does building new systems produce organizational change?

Answered: 1 week ago