Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 items 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, items 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 items 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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

make sense of basic terminology used in quantitative data analysis;

Answered: 1 week ago

Question

1.what is the significance of Taxonomy ?

Answered: 1 week ago

Question

What are the advantages and disadvantages of leasing ?

Answered: 1 week ago

Question

Name is needed for identifying organisms ?

Answered: 1 week ago

Question

LO2 Discuss important legal areas regarding safety and health.

Answered: 1 week ago