1. Engineering
  2. Computer Science
  3. in basic c you will be creating a custom class...

Question: in basic c you will be creating a custom class...

Question details

IN BASIC C# You will be creating a custom class that will hold information about products for an inventory in an online store. The product must contain the name of the item, the cost to make it, and the item’s selling price. The user will be given a menu of the items and asked to choose one of the products. Once selected your program should give the chosen items information back to the user. 1. First create a new custom class file called Product. 2. Create your 3 member variables and the constructor function to build the object. a. These member variables should be name, cost to make, item’s selling price. 3. Create Getters and Setters for each of the 3 member variables 4. Code a custom method in the class file that will calculate the total profit for that item. Remember profit is the difference between what it cost to make and what it will be sold for times the number of items. a. This method should use the member variables to calculate the profit. b. This method should have 1 parameter for quantity of items to be sold. 5. In your Main Method: a. Instantiate (3) products. You may hard code these values. i. These will be the products that you will have in your store. b. Give the user a menu that will show the names of your products. c. Prompt the user for the number of the item that they would like to see more information on. i. Make sure to validate this number and check to make sure it is a valid choice. d. Once the item is chosen: i. Give the user the name, cost to make, and item’s selling price. ii. Then use your custom function to tell them the profit that you will make selling one of that item. 1. For this function call, hard-code an integer of 1. e. Next we will figure out how much profit you will make for a certain number of that item. i. Ask the user for the quantity of that specific item. ii. Validate and convert this number. 1. Use this number as the argument in the function call to determine the total profit for the item. • User Input (Ask & Validate In Main Method, Use To Instantiate Object as the Member Variables): o Item # they would like to see more information o The quantity of the chosen item that they would like to calculate the profit of. • Constructor Function: o Take in all member variables and create an object from them • Custom Function o This function should be in the custom function and should use the member variables to calculate the profit for that item.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution