Welcome to the Most Reliable Essay writing Service Online

c++project: Classes and Objects Modified(

by | Mar 26

 

In this project you are to construct a simple Auto Parts database.  In order to make it simple we will keep the parts in an array.  Each part is defined by a part class and the Data Base is also a Class. If you see a problem with the specification it is you responsibility to bring it to my attention quickly.  Use the Visual Studio support to add these classes as discussed in class.

Part Class 

Each part has a Name of type string, a 9 digit ID number of type string, a weight of type double,  maximum in-store count of type int and an actual in-store count of type int.  These should all be private. The class that defines this type should also include a parameterized constructor.

           Part Class Specification
Private Attributes:
 _name : string      // Name of part
 _ID : string        // ID of part eg 132436353
 _weight : double    // eg 23.4 oz
 _count : integer    // 10 items in store
 _maxCount: integer  // Store has room for 15 parts of this type
Public Methods:
 Part(name,id,wt,ct,max) // constructor
 ~Part() // destructor is not used in this project
 string GetID()  // returns the 9 digit ID string
 string GetName() // returns the name of this part
 double GetWeight() //returns the weight
 int GetCount() // returns the in-store count.
 void SetCount(int i)  // update count       << -- modified 9/20/2017
 int GetMax() // returns the maximum number of parts for this part
 void AddToInv(int i) // Add i parts to this parts inventory ie update _count
 void RemoveFromInv(int i) // remove i parts from this parts inventory ie update _count

PartBase Class

This class encapsulates an array of Parts.  This is basically an inventory of all the car parts in the store. You can set the array size to 1000 for this project since the number of parts kept at the store is less than 1000.

           PartBase Class specification
Private Attributes:
  _partList[10]:Part   // array of a maximum of 10 parts
  _size : integer  // number of different part types in DB
Public Methods:
  int AddNewPart(Part p) // adds NEW part type to inventory, inc size
                          // returns -1 if database full, -2 if part
                          // already in database. Do nothing in this case
  int AddToInv(PartID, i) // add i to part count, ie AddToInv(), return  <<- modified 9/19/17
                          // -1 if part p is not in database. return -2
                          // if i+_count>_maxCount. Do nothing
  int Sell(PartID, i) // sell i copies of Part PartID. ie RemoveFromInv(), return <<-Modified
                         // -1 if part p is not in database. If there are
                         // not enough parts to fill order return -2 ,do
                         // not update part p.
  int GetPartCt(PartID)  // return the number of parts of type p on the shelf <<-Modified
                         // return -1 if part is not in database
  double GetWeightOfDB()  // return the total weight of the database
  void Print()            // prints the parts in database using format below

You project is to implement the above two classes and then write a main program that reads in and processes a list of transactions.  There are 4 types of transactions( AddPart, Sell, AddToInv and Print) The format of these transactions are shown in the example below. When a transaction is properly performed you should print the following for each type.

  • AddPart ::        New Part name (ID) added to inventory
  • Sell ::                 Sold  ct  name (ID) parts,  # parts left
  • AddToInv::      ct new name(ID) parts added to inventory, # parts available
  • Print::      each line should have this format -> Fuel_Pump 234343213 123.4 5 5 with weight and total part count added at the end

If there is an error in the transaction then print the error as follows

  • AddPart ::        Error:DataBase Full  or   Error:Part ID is already in DataBase
  • Sell ::              Error:Not enough name(ID) parts available or Error:Part name(ID) not in DataBase on Sell
  • AddToInv::    Error:No room available for part name(ID) or Error:Part name(ID) not in DataBase on AddToInv
  • Print::      This should work
Example Transactions
AddPart Fuel_Pump 234343213 123.4 5 5  //adds new part to db
AddPart Hose 344343223 23.4 4 10
AddPart Hose 123243543 18.5 2 5
AddPart Water_Pump 44300223 23.4 2 4
AddPart Antifreeze 545343211 23.4 3 5
Sell 344343223 1                       // updates this parts _count
Sell 44300223 2
AddToInv 545343211 2                   // updates this parts _count
Sell 44300223 1                        // no more parts
Print                               // print out the database. the last
                                   // line should be Total Weight = #, Total Part count = #

In developing this project you need to create a lot more transactions to test your cde.  Be sure and create transactions that will create all the possible errors.  I will give you the required transaction data a couple days before it is due so test carefully.  Also document as I have requested. See program documentation and submission format a the top of this page.

  

CLIENT TESTIMONIALS

The Service Is Okay. I won’t Complain

The writers on the website are courteous and the customer service responds quickly. My paper was handled well; They promised...

Writers here are very professional and are native British

Thanks a lot for helping me out with my PhD Thesis, Writers here are very professional and are native British!!

Jack, The United Kingdom

Very Very Helpful, and On time.

Very Very Helpful, and On time.

Adelio M, Spain

I scored complete A’s in 3 out of four courses

I scored complete A’s in 3 out of four courses

Anonymous, Illinoi Chicago

CLICK HERE  To order your paper

About Essaysmiths Assignment writing service

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for upto 20% off in their first Order. Our payment method is safe and secure.

 CLICK HERE to Order Your Assignment

 

Order your Assignment today and save 15% with the discount code ESSAYHELP

X