C++ writing assignment

已关闭 已发布的 Mar 16, 2015 货到付款
已关闭 货到付款

Please create the pseudocode, and then code, debug, and create the submittal files for following problem:

Design an inventory class that can hold information and calculate data for prints created and sold by the large format photography dude (see Lesson 11 Assignment. All the variables will be private and all the member functions will be public.

Variable Name: Description (all are private)

imageNumber an int that holds the item's image number

imageName a string that holds the image name (up to 50 characters)

filmType a string that holds the film type used (string - up to 10 characters)

numberPrints an int that holds the number of prints created

pricePrints a double that holds the sales price of each print

printsSold an int that holds the number of prints sold to date

totalIncome a double that holds the total income (calculated as pricePrints * printsSold)

Member Functions Description (all are public)

Default Constructor sets all the member variables to 0 or to " "

Constructor #2 accepts a print's imageNumber, imageName, filmType, numberPrints, pricePrints, printsSold. The function should copy these values to the appropriate variables and then calls the setTotalIncome function.

setImageNumber accepts an integer argument that is copied to the imageNumber variable - validate for >0

setImageName accepts a string argument that is copied to the imageName variable - validate for not empty

setFilmType accepts a string argument that is copied to the filmType variable - validate for not empty

setNumberPrints accepts an integer argument that is copied to the numberPrints variable - validate for >=0

setPricePrints accepts a double argument that is copied to the pricePrints variable - validate for >0

setPrintsSold accepts an int argument that is copied to the printsSold variable - validate for >= 0

setTotalIncome calculates the total income made from sales (pricePrints * printsSold)

getImageNumber returns the value in imageNumber variable

getImageName returns the value in imageName variable

getFilmType returns the value in filmType variable

getNumberPrints returns the value in numberPrints variable

getPricePrints returns the value in pricePrints variable

getPrintsSold returns the value in printsSold variable

getTotalIncome returns the value in totalIncome variable

***

The mutator functions should have an additional layer of validation protection as described in the list above. Creating this bottom-level layer of protection does not negate the need to validate the user input in whatever function calls the mutator function. Make sure to review page 744, "contents of [url removed, login to view](Version 2)" for an example of exit_failure. Remember, your data is protected by it's member functions. You can't trust anybody!

--------

Demonstrate the class in main() as follows:

1. create an array of 3 print objects

2. use member constructor functions to initalize the objects

3. get user input, validate the user input (the way we did last for the assignment for chapter 11) and then set the variables (using the mutator functions).

4. display the data (using the accessor functions).

As usual, make your display look good. This should be pretty easy by now, right?

Submit to me the following files and URL**note that the pdf has changed in scope. For this assignment, no pseudocode, but I've added other things.

1. [url removed, login to view]

2. inventory.h

3. [url removed, login to view]

4. PDF containing a UML diagram

C++编程

项目ID: #7318760

关于项目

远程项目 活跃的Apr 22, 2015