subject

Here are the method descriptions for the three classes: Product:

A Product object represents a product with an ID code, title, description, price and quantity available.

init method - Takes as parameters five values with which to initialize the Product: it's ID, title, description, price, and quantity_available. You can assume unique IDs will be used.
get methods for each of the data members, named get_product_id, get_title, get_description, get_price, and get_quantity_available
decrease_quantity - Decreases the quantity available by one
Customer:

A Customer object represents a customer with a name and account ID. Customers must be members of the Store to make a purchase. Premium members get free shipping.

init method - Takes as parameters three values with which to initialize the Customer: their name, ID, and whether the customer is a premium_member (that last one is a Boolean value).
A customer's cart is a collection of Product ID codes - you can choose what type of collection (e. g. list, dictionary, etc.). Since the cart is private, you'll also need to create a get method for it
get methods named get_name and get_customer_id
is_premium_member - Returns whether the customer is a premium member (True or False)
add_product_to_cart - Takes a product ID code and adds it to the Customer's cart
empty_cart - Empties the Customer's cart
Store:

A Store object represents a store, which has some number of products in its inventory and some number of customers as members.

A Store's inventory is a collection of Products that are part of the Store - you can choose what type of collection (e. g. list, dictionary, etc.)
A Store's membership is a collection of Customers that are members of the Store - you can choose what type of collection (e. g. list, dictionary, etc.)
init method - Does whatever initialization is needed for your Store
add_product - Takes a Product object and adds it to the inventory
add_member - Takes a Customer object and adds it to the membership
get_product_from_id - Takes a Product ID and returns the Product with the matching ID. If no matching ID is found in the inventory, it returns the special value None
get_member_from_id - Takes a Customer ID and returns the Customer with the matching ID. If no matching ID is found in the membership, it returns the special value None
product_search - Takes a search string and returns a sorted (in lexicographic order) list of ID codes for every product in the inventory whose title or description contains the search string. The search should be case-insensitive, i. e. a search for "wood" should match Products that have "Wood" in their title or description, and a search for "Wood" should match Products that have "wood" in their title or description (such as "woodchuck"). The list of ID codes should not contain duplicates. You may assume that the search string will consist of a single word. If the search string is not found, return an empty list.
add_product_to_member_cart - Takes a Product ID and a Customer ID (in that order). If the product isn't found in the inventory, return "product ID not found". If the product was found, but the member isn't found in the membership, return "member ID not found". If both are found and the product is still available, call the member's addProductToCart method to add the product and then return "product added to cart". If the product was not still available, return "product out of stock". This function does not need to check how many of that product are available - just that there is at least one. It should not change how many are available - that happens during checkout. The same product can be added multiple times if the customer wants more than one of something.
check_out_member - Takes a Customer ID. If the ID doesn't match a member of the Store, raise an InvalidCheckoutError (you'll need to define this exception class). Otherwise return the charge for the member's cart. This will be the total cost of all the items in the cart, not including any items that are not in the inventory or are out of stock, plus the shipping cost. If a product is not out of stock, you should add its cost to the total and decrease the available quantity of that product by 1. Note that it is possible for an item to go out of stock during checkout. For example, if the customer has two of the same product in their cart, but the store only has one of that product left, the customer will be able to buy the one that's available, but won't be able to buy a second one, because it's now out of stock. For premium members, the shipping cost is $0. For normal members, the shipping cost is 7% of the total cost of the items in the cart. When the charge for the member's cart has been tabulated, the member's cart should be emptied, and the charge amount returned. Don't round any results.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:40
Match the personality traits with their description
Answers: 2
question
Computers and Technology, 22.06.2019 18:10
Assume that to_the_power_of is a function that expects two int parameters and returns the value of the first parameter raised to the power of the second parameter. write a statement that calls to_the_power_of to compute the value of cube_side raised to the power of 3 and that associates this value with cube_volume.
Answers: 1
question
Computers and Technology, 22.06.2019 19:10
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 1
question
Computers and Technology, 23.06.2019 01:40
Writing a modular program in visual c++. i am new to this and not sure what i am missing. i am getting the following error: baddate.cpp: in function ‘int main()’: baddate.cpp: 50: 3: error: ‘else’ without a previous ‘if’elsehere are the instructions and code: writing a modular program in c++in this lab, you add the input and output statements to a partially completed c++ program. when completed, the user should be able to enter a year, a month, and a day. the program then determines if the date is valid. valid years are those that are greater than 0, valid months include the values 1 through 12, and valid days include the values 1 through 31.notice that variables have been declared for you.write the simulated housekeeping() function that contains the prompts and input statements to retrieve a year, a month, and a day from the user.include the output statements in the simulated endofjob() function. the format of the output is as follows: month/day/year is a valid date.ormonth/day/year is an invalid date.execute the program entering the following date: month = 5, day = 32, year = 2014. record the output of this program.execute the program entering the following date: month = 9, day = 21, year = 2002. record the output of this /* program name: baddate.cppfunction: this program determines if a date entered by the user is valid.input: interactiveoutput: valid date is printed or user is alerted that an invalid date was entered*/#include bool validatedate(int, int, int); using namespace std; int main(){// declare variablesint year; int month; int day; const int min_year = 0, min_month = 1, max_month = 12, min_day = 1, max_day = 31; bool validdate = true; // this is the work of the housekeeping() method// get the year, then the month, then the daycout< < "enter the year"< > year; cout< < "enter the month"< > month; cout< < "enter the day"< > day; // this is the work of the detailloop() method// check to be sure date is validif(year < = min_year) // invalid yearvaliddate = false; else if (month < min_month || month > max_month) // invalid monthvaliddate = false; else if (day < min_day || day > max_day) // invalid dayvaliddate = false; // this is the work of the endofjob() method// test to see if date is valid and output date and whether it is valid or notif(validdate == true); {// output statementcout<
Answers: 1
You know the right answer?
Here are the method descriptions for the three classes: Product:

A Product object repre...
Questions
question
Mathematics, 15.12.2020 07:10
Questions on the website: 13722363