Question
Written in c# only please :) Whenever asking the user for input, their response must be on the same line as the question. For example,
Written in c# only please :)
Whenever asking the user for input, their response must be on the same line as the question. For example, if asking for a quantity and the user enters the value 10, the console screen should look like this: Please enter the quantity: 10 To get the cursor to sit on the same line as the question, you need to use Console.Write(...) instead of Console.WriteLine(...).
Every console project must display "Press any key to continue" and pause at the end of the project, waiting for the user to review the results.
In the Unit Testing course, you learned that it can be far more effective to begin with the tests, then write the code -- a TDD (test driven development) approach. You will need to write and run unit tests in this project, so read through the instructions with that requirement in mind. How you write the code could be very different if you start with the tests in mind. You might write different or more methods to be able to run the unit tests.
Project: Warehouse Inventory
Create a project that describes the warehouse inventory for a company. The warehouse is a generic collection which implements the IEnumerable interface to be able to iterate through the inventory products. The project will instantiate a number of products, list them out in a ForEach loop, calculate the warehouse value of each product (price * quantity), calculate the total value of all items in the warehouse, and determine which item has the greatest value and which one has the smallest value.
Here is an example:
Begin with a class for product, which has an ID, a name, a price, and a quantity. Use auto-implemented properties to manage each of those instance variables. Create a class for a warehouse, which is a generic collection and implements the generic IEnumerable interface. In this project, the warehouse collection is an array of products, holding 8 objects. In the Main method, instantiate 8 different products (see above) and add them to the warehouse. Using a ForEach loop, display each product's information and the calculated warehouse value of that product (warehouse value = price * quantity). Accumulate those warehouse values, and after displaying the products, display the total warehouse value for all products.
Find the product with the largest warehouse value and the product with the smallest warehouse value and list them. Use the IComparable interface to compare two products. One product is "greater than" another product if its warehouse value is larger.
You must write and run unit tests for each calculation method and result, with at least 5 sets of data in each test. Take screenshots showing successful unit tests.
Module 2 Competency Project by Student Name 123 pen: price $2.59, quantity 100 Item Value: $259.00 456 pencil: price $1.09, quantity 200 Item Value: $218.00 789 eraser: price $1.75, quantity 150 Item Value: $262.50 579 staples: price $2.29, quantity 175 Item Value: $400.75 432 paper: price $5.49, quantity 125 Item Value: $686.25 807 clips: price $3.29, quantity 150 Item Value: $493.50 612 magnets: price $1.59, quantity 170 Item Value: $270.30 206 pushpins: price $1.09, quantity 180 Item Value: $196.20 Total Value in Warehouse: $2,786.50 Item with largest value: 432 paper: price $5.49, quantity 125 Item with smallest value: 206 pushpins: price $1.09, quantity 180 Press any key when doneStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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