Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Cart ClassCart - databaseName: string + Cart ( ) : + Cart ( string databaseName ) + viewCart ( string userID, string inventoryDatabase ) :
Cart ClassCart databaseName: string Cart: Cartstring databaseName viewCartstring userID, string inventoryDatabase: void addToCartstring userID, string ISBN, int quantity: void removeFromCartstring userID, string ISBN: void checkOutstring userID: voidDescription:This handles all Cart interactions including interfacing with the Cart database defined below.Assumptions Made:Continuing from the previous classes, theres minimal class variables here. The Cart class hasthe user ID sent from the main gathered from the User class for a lot of the functionality tomake sure cart items are linked to the appropriate user. This is used as a parameter instead of aclass variable to aid in limited changes needing to occur upon logout of a user. So it makes fora more seamless process.This also has the only instance of one class calling another relying on the Inventory class forsome of the functions.Finally, input and output is utilized in this class.Function Descriptions: Cart: Zero constructor. Nothing needs to be initialized here, but it allows for thefunctions to be used. Cartstring databaseName: Initially sets up the database that will be used throughoutthe class to access the appropriate database tables viewCartstring userID, string inventoryDatabase: Displays all books in the logged inUsers cart. Please note: this cooperates with the inventory database to display all thecorrect information on the inventory items it just selectively shows the books in theUsers cart addToCartstring userID, string ISBN, int quantity: This relies on the user viewing theinventory previously from the main. Once they select a book, this ISBN is used to add
Cart ClassCart databaseName: string Cart: Cartstring databaseName viewCartstring userID, string inventoryDatabase: void addToCartstring userID, string ISBN, int quantity: void removeFromCartstring userID, string ISBN: void checkOutstring userID: voidDescription:This handles all Cart interactions including interfacing with the Cart database defined below.Assumptions Made:Continuing from the previous classes, theres minimal class variables here. The Cart class hasthe user ID sent from the main gathered from the User class for a lot of the functionality tomake sure cart items are linked to the appropriate user. This is used as a parameter instead of aclass variable to aid in limited changes needing to occur upon logout of a user. So it makes fora more seamless process.This also has the only instance of one class calling another relying on the Inventory class forsome of the functions.Finally, input and output is utilized in this class.Function Descriptions: Cart: Zero constructor. Nothing needs to be initialized here, but it allows for thefunctions to be used. Cartstring databaseName: Initially sets up the database that will be used throughoutthe class to access the appropriate database tables viewCartstring userID, string inventoryDatabase: Displays all books in the logged inUsers cart. Please note: this cooperates with the inventory database to display all thecorrect information on the inventory items it just selectively shows the books in theUsers cart addToCartstring userID, string ISBN, int quantity: This relies on the user viewing theinventory previously from the main. Once they select a book, this ISBN is used to add
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started