Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this program must be written in c++ and should work on a linux machine or server. That means it shouldn't contain conio.h or any header

this program must be written in c++ and should work on a linux machine or server. That means it shouldn't contain conio.h or any header files that will prevent it from not working on linux machine.

Program Description:

Create two classes named as Stationary and Beverage. Think of proper attributes for each class. each attribute must have a name. Stationary Items: Book, Notebook, Scrapbook, Pen, Marker, Erasers, etc. Beverages: Mocha, Latte, Espresso, Americano, Regular, Tea, Iced Tea, Coke, etc. You can think of any number of attributes that are related to these items. In order to keep the design simple, add all of these attributes to the stationary class. If some attributes are not applicable to a particular stationary item (e.g. erasability does not fit to Book or Notebook), then set it to some predefined value. For example, if you declare erasability as String, then set it to NA for Books and Pens. For the beverage class, you can think of basic properties as name, type (hot or cold), calories, size (tall, medium, regular, etc). All of these items from both categories should have price associated with them. Now, create a third class: Barnes_and_Nobel. This class should contain two vectors: one is stationary and the other is beverage. Add appropriate functions (at least few constructors, one destructor, set methods, and get methods). Also, each attribute should be private and the functions should be public. Each class should have its own definition file (Stationary.h, Beverage.h, Barnes_and_Nobel.h) and own class implementation file (Stationary.cpp, Beverage.cpp, Barnes_and_Nobel.cpp). In a separate file (say, program_01.cpp), write a main function that has a user-friendly menu in it. From the menu the user can insert some stationary/beverage items into the barnes_and_nobel object, print the existing items, remove some items. I am assuming you will be using the name attribute to find an item.

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

Step: 3

blur-text-image

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago