Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PSEUDOCODE ONLY NEEDED FOR THIS CHEGG QUESTION: Please create the pseudocode, an

ID: 3818840 • Letter: P

Question

PSEUDOCODE ONLY NEEDED FOR THIS CHEGG QUESTION:

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 photography dude (see Lesson 11 Assignment All the member variables will be private and all the member functions will be public Variable Name: Description (a are private) image Number an int that holds the item's image number a string that holds the image name up to 25 characters) image Name filmType a string that holds the film type used (string up to 5 characters a float that holds the sales price of each print price Prints prints Sold an int that holds the number of prints sold to date 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, pricePrints, prints Sold. The function should copy these values to the appropriate variables. setlmageNumber accepts an integer argument that is copied to the imageNumber variable validate for 0 accepts a string argument that is copied to the imageName variable validate for not empty setlmageName accepts a string argument that is copied to the filmType variable validate for not empty etFilmType accepts a float argument that is copied to the pricePrints variable validate for 0 setPrice Prints setPrints Sold accepts an int argument that is copied to the printsSold variable validate for 0 calculates the total income made from sales (pricePrints printsSold getTota ncome getlmageNumber returns the value in imageNumber variable getlmageName return the value in imageName variable get FilmType returns the value in filmType variable getPricePrints returns the value in pricePrints variable returns the value in printsSold variable get PrintsSold 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 Rectangle. cpp(Version 2) for an example of exit failure. Remember, your data is protected by it's member functions. You can't trust anybody! Use your integer input function and your float input function as you did before

Explanation / Answer

Pseudocode :

Main
Create an array of class objects
Declare imgNums as integer
Declare priPrts as integer
Declare prntSold as integer
Declare imgNmes as string
Declare flmTypes as string
for read user information is less than or equal to size of array object
   read image number from user
   check imgNums is greater than 0 and set the image number using function call.
   read image name from user
   check imgNmes is not empty and set the image name using function call.
   read film type from user
   check flmTypes is not empty and set the film type using funtion call.
   read price prints from user
   check priPrts is greater than 0 and set the price prints using function call.
   read prints sold from user
   check prntSold is greater than or equal to zero and set the prints sold using function call.
  
   print or display image number
   print or display image name
   print or display film type
   print or display price prints
   print or display prints sold
end for

Sample Code:

#include <iostream>
#include <string>
using namespace std;

class Inventory{
   private:
       int imageNumber;
       string imageName;
       string filmType;
       int pricePrints;
       int printsSold;
   public:
       Inventory()
       {
           imageNumber = 0; imageName = ""; filmType = ""; pricePrints=0; printsSold=0;
       }
       Inventory(int imgNumber, string imgName, string flmType, int pPrints, int pSold);
       void setImageNumber(int imgNumber)
       {
           //validate imgNumber is greater than 0 and copy it to imageNumber
           if(imgNumber>0)
           {
               imageNumber = imgNumber;
           }
       }
       void setImageName(string imgName)
       {
           //validate imgName is not empty and copy it to imageName
           if(imgName.empty())
           {
               imageName = imgName;
           }
       }
       void setFilmType(string flmType)
       {
           //validate flmType is not empty and copy it to filmType
           if(flmType.empty())
           {
               filmType = flmType;
           }
       }
       void setPricePrints(int pPrints)
       {
           //validate pPrints is greater than 0 and copy it to pricePrints
           if(pPrints>0)
           {
               pricePrints = pPrints;
           }
       }
       void setPrintsSold(int pSold)
       {
           //validate pSold is greater than or equal to zero and copy it to printsSold
           if(pSold>=0)
           {
               printsSold = pSold;
           }
       }
       int getTotalIncome()
       {
           //Caluculate total income
           int totalIncome = pricePrints * printsSold;
           return totalIncome;
       }
       int getImageNumber()
       {
           //return image number. like,
           return imageNumber;
       }
       string getImageName()
       {
           //return image name. like,
           return imageName;
       }
       string getFilmType()
       {
           //return film type. like,
           return filmType;
       }
       int getPricePrints()
       {
           //return price prints. like,
           return pricePrints;
       }
       int getPrintsSold()
       {
           //return print sold. like,
           return printsSold;
       }
      
};

int main(){
   Inventory print[3];
   int imgNums, priPrts, prntSold;
   string imgNmes, flmTypes;
  
   for (int i=0; i<2; i++)
   {
       cout << "Enter the image number";
       cin>>imgNums;
       print[i].setImageNumber(imgNums);
       cout << "Enter the image name";
       cin>>imgNmes;
       print[i].setImageName(imgNmes);
       cout << "Enter the image film type;";
       cin>>flmTypes;
       print[i].setFilmType(flmTypes);
       cout << "Enter the image price prints";
       cin>>priPrts;
       print[i].setPricePrints(priPrts);
       cout << "Enter the image prints sold";
       cin>>prntSold;
       print[i].setPrintsSold(prntSold);
      
       cout << print[i].getImageNumber()<<endl;
       cout << print[i].getImageName()<<endl;
       cout << print[i].getFilmType()<<endl;
       cout << print[i].getPricePrints()<<endl;
       cout << print[i].getPrintsSold()<<endl;
   }
   return 0;
}

Note: setImageNumber, setImageName, setFilmType, setPricePrints, setPrintsSold methods are called as mutator methods/functions. getImageNumber, getImageName, getFilmType, getPricePrints and getPrintsSold methods/functions are called as accessor functions.