- #1
carl123
- 56
- 0
Write a C++ program based on the following scenario:
You customer wants you to design and then build an online store:
Abilities the customer wants in the system:
Track products and related information.
Track customers, especially what the customer owes
Identify a product that will be for sale. You should read in the name, model number, wholesale cost, and retail cost for the product.
Enter a new customer. You should read in the customer name and ID.
Take a shipment of new products. Read in the model number and quantity. If you don't know what the product is that you're getting, reject the shipment, otherwise add that to inventory.
Let a customer buy something. The customer ID, product model number, and quantity should be taken as input.
If there is sufficient quantity of the product on hand, then the customer should be charged that amount and the product be deducted from inventory.
If there is not sufficient quantity, the sale should be rejected.
Let a customer make a payment. Read in the customer ID and the amount of payment. It's OK for customers to have a positive balance, but they cannot make negative payments.
Find out about a customer: enter a customer ID number, and print out the customer's name, current balance, and a list of what the customer has previously purchased.
Find out about a product: enter a model number and get the name of the product, the amount that has already been sold, and the amount in inventory.
My thoughts so far:
I opted to write the code by using classes.
My proposed classes are customerInfo, productInfo, newShipment, and purchases
I'm confused on what information to make public or private in these classes
You customer wants you to design and then build an online store:
Abilities the customer wants in the system:
Track products and related information.
Track customers, especially what the customer owes
Identify a product that will be for sale. You should read in the name, model number, wholesale cost, and retail cost for the product.
Enter a new customer. You should read in the customer name and ID.
Take a shipment of new products. Read in the model number and quantity. If you don't know what the product is that you're getting, reject the shipment, otherwise add that to inventory.
Let a customer buy something. The customer ID, product model number, and quantity should be taken as input.
If there is sufficient quantity of the product on hand, then the customer should be charged that amount and the product be deducted from inventory.
If there is not sufficient quantity, the sale should be rejected.
Let a customer make a payment. Read in the customer ID and the amount of payment. It's OK for customers to have a positive balance, but they cannot make negative payments.
Find out about a customer: enter a customer ID number, and print out the customer's name, current balance, and a list of what the customer has previously purchased.
Find out about a product: enter a model number and get the name of the product, the amount that has already been sold, and the amount in inventory.
My thoughts so far:
I opted to write the code by using classes.
My proposed classes are customerInfo, productInfo, newShipment, and purchases
I'm confused on what information to make public or private in these classes
Last edited: