Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Programming Language Expert

Introduction

This assignment follows the application to examine the problem of managing the accounts and inventory for a bookstore. In this assignment, we focus on different types of inventory and you are required to develop a solution using the C++ language that has the following features:

• Handles different types of inventory;

• Record the Purchases and Sales based on the type of item and an assigned mark-up; and

• Uses a pointer array of inventory to store the different items in.

Requirements

This assignment requires you to prepare C++ code to implement four classes Note that while some of these classes are related to those developed in the second assignments, the functionality of those assignments has been significantly reduced to focus on polymorphism and templates, e.g., both SalesRegister and Publisher classes are removed. The classes you must develop are:

A Template SimpleList class:

•    The SimpleList class must have the following features:

•    Attribute/s to store the constant array pointer list of the Inventory

•    objects and the count to keep track current element.

•    Accessor and/or manipulator methods where appropriate

•    AddElement function will check to make sure the current item is not reached the size before adding the parameter object on to the array list

•    A constructor to initialise the Simple Item array list object

•    A Print() has an output operator to format appropriately the data stored on the simple lis (sensible field widths should be used).

•    A GetCount() return the current number of item on the array

•    A GetItem(int position) return the item element on the array list at the parameter position.

An Inventory class:

This is an abstract class which has 4 pure virtual functions:

•    A GetItemData() function allows to prompt user for the item details ;

•    A RecordSales() function will update the sold quantity for the inventory if the stock is higher or equal to the sold quantity parameter;

•    A RecordPurchase() function will update the purchase quantity for the inventory by the sold quantity parameter;

•    A Print() function display the inventory item details and purchased and sold information

A StockItem class is inherited from the Inventory class:

• Has cost price, mark-up, sold quantity and purchase quantity attributes;

• Has a custom constructor, accessor and mutator functions for the above description attributes; and

• And four other virtual functions to implement the RecordSales() and throw exception if there is not enough stock for the transaction record, GetData(), RecordPurchase() and Print() which described in the Inventory class.

A GeneralItem class is inherited from the StockItem class :

• Has the item description attribute;

• The GetData() function will prompt the user to input the item description attribute and the markup attribute from the StockItem;

• Has a custom constructor, accessor and mutator functions for the above description attributes; and

• And the Print() display description attributes and all StockItem details.

A BookItem class is inherited from the GeneralItem class :

• Has the extra Book Author, Publisher and Year attributes;

• The GetData() function will prompt the user to input the author, publisher, year details and the markup attribute from the StockItem;

• Has a custom constructor, accessor and mutator functions for the above description attributes; and

• And the Print() display described attributes and all StockItem details.

Your assignment must also satisfy the following requirements:

• You must use polymorphism in your solution to record the sales, purchases, get data and print functions;

• You do not need to consider exceptions for this assignment (they will return in the final assignment);

• Tabs (\t) can be used for formatting purposes;

• You must use the main() function, above. Note that not all functions required above may be invoked by the provided main(); and

• All floating point data should be displayed to two decimal places. For information on how to set the number of decimal places, see the Manipulators
You do not need to restore the number of decimal places

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91533

Have any Question? 


Related Questions in Programming Language

Suppose that we implement the functions of figure using a

Suppose that we implement the functions of Figure using a display. Show the display at the moment the first call to fib0(1) is about to return. Also, indicate the saved display entry in each of the activation records on ...

Note that these regular expressions give all of the

Note that these regular expressions give all of the following symbols (operator characters) a special meaning: \ " . - $ [ ] * + ? { } | / Their special meaning must be turned off if they are needed to represent them-sel ...

Assignmentmany applications impose rules for user passwords

Assignment Many applications impose rules for user passwords. Write a program that utilizes methods to check a user entered password ***** print out either "Valid" or "Invalid", based on the following rules: • Password * ...

Assignmentpart 1 instance data and methods belong to

Assignment Part 1 Instance data and methods belong to objects (which are class members) and static data and methods belong to a class as a whole. Consider the real-life class named StatelnTheUnitedStates. Name some real- ...

The concepts discussed in this section can also be applied

The concepts discussed in this section can also be applied to eliminate partially dead code. A definition of a variable is partial ly dead if the variable is live on some paths and not others. We can optimize the program ...

Derive a class programmer from employee supply a

Derive a class Programmer from Employee. Supply a constructor Programmer Exercise 1: Derive a class Programmer from Employee. Supply a constructor Programmer (string name, double salary) that calls the base-class constru ...

Programming computer science assignmmentprogramming1

Programming Computer Science Assignmment Programming 1) Explain the difference between an event and an event handler. Provide at least two examples of an event. 2) Explain how an animation uses still images and loops to ...

Business app programmingwrite the following programwrite a

Business App Programming Write the following Program: Write a Java program to the form below. The program must work with decimal numbers and each button must work correctly. The result must be done in a popup window. The ...

The air pollution level of a city on a given day is a

The air pollution level of a city on a given day is a function of the time of day (in hours). As an environmental specialist, you have collected carbon dioxide level readings at different times. An example of one day of ...

Assignmentindent code and insert comments to document your

Assignment Indent code and insert comments to document your program. Program must be implemented and run as instructed. Source file and executable are placed in a folder. Define the class with the name BankAccount to sto ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen