Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This instructions for the assignment are posted below. As well as the programm in C# that I have at the moment, which I am using

This instructions for the assignment are posted below. As well as the programm in C# that I have at the moment, which I am using a Mac. I have multpile quesitons:

image text in transcribed

QUESTIONS:

1. Even though I have inventoryList defined and decalared as "List inventoryList = new List();" in my Main, when I try to use it in a method I receive an erro when typing " for (int i = 0; i

2: How do I call the option/method that allows the user to move a menu option into a Used Inventory List?

3. How do I call upond the Inventory report option?

MY CODE:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SmallGroupProject { class Program { public static void Main(string[] args) { // LIST THE ITEM IN INVENTORY List inventoryList = new List(); // DECLARING VARIABLES string itemID, descrip; bool inventoryCheck = false; // DO WHILE LOOP do { // PROMPT USER TO INPUT INFORMATION Console.WriteLine("Please input the number that corresponds with the desired action:"); Console.WriteLine("Option 1: Add items to the inventory."); Console.WriteLine("Option 2: Report the total cost of the inventory on hand."); Console.WriteLine("Option 3: Report the total value of inventory on hand."); Console.WriteLine("Option 4: Exit Application"); bool isUserValid = int.TryParse(Console.ReadLine(), out int userResponse); // CREATING IF CONDITION TO ADD ITEM switch (userResponse) { case 1: { // PROMPT THE USER TO INPUT ITEM ID Console.WriteLine("Please enter the itemID"); // HOLD THE INPUT BY USER itemID = Console.ReadLine(); // PROMPT THE USER TO INPUT QUANTITY Console.WriteLine("Please enter the quantity of the item."); // HOLDING USER INPUT // ORIGINAL PROGRAM DID NOT ACCOUNT FOR USER ERROR // IT JUST CONTAINED THE LINE COMMENTED OUT BELOW //qty = Convert.ToInt32(Console.ReadLine()); bool isQtyValid = int.TryParse(Console.ReadLine(), out int qty); while (!isQtyValid) { Console.WriteLine("Error: Please enter a whole number."); isQtyValid = int.TryParse(Console.ReadLine(), out qty); } // PROMPT THE USER TO INPUT COST PRICE Console.WriteLine("Please enter the cost price of the item."); // HOLDING USER'S COST PRICE // ORIGINAL PROGRAM DID NOT ACCOUNT FOR USER ERROR // IT JUST CONTAINED THE LINE COMMENTED OUT BELOW // cost = Convert.ToDecimal(Console.ReadLine()); bool isCostValid = decimal.TryParse(Console.ReadLine(), out decimal cost); while (!isCostValid) { Console.WriteLine("Error: Please enter a decimal or whole number."); isCostValid = decimal.TryParse(Console.ReadLine(), out cost); } // PROMPT THE USER TO INPUT VALUE OF ITEM Console.WriteLine("Please enter the value of the item."); // HOLDING USER'S ENTRY // ORIGINAL PROGRAM DID NOT ACCOUNT FOR USER ERROR // IT JUST CONTAINED THE LINE COMMENTED OUT BELOW // price = Convert.ToDecimal(Console.ReadLine()); bool isPriceValid = decimal.TryParse(Console.ReadLine(), out decimal price); while (!isPriceValid) { Console.WriteLine("Error: Please enter a decimal or whole number."); isPriceValid = decimal.TryParse(Console.ReadLine(), out price); } // PROMPT THE USER TO INPUT ITEM'S DESCRIPTION Console.WriteLine("Please enter the item description."); // HOLDING USER'S INPUT descrip = Console.ReadLine(); Console.WriteLine("Item has been properly saved, thank you."); Console.WriteLine(" "); //ADDING ALL THE ITEMS IN INVENTORY inventoryList.Add(new InventoryItem(itemID, descrip, qty, cost, price)); break; } case 2: // CREATING CONDITIONS TO CALCULATE COST // DECLARING VARIABLES decimal costPrice = 0; // CREATING FOOR LOOP for (int i = 0; i

Add a Meal class. Each Meal has a description and price. (For example, Macaroni and Cheese with Lobster $7.50, Macaroni and Cheese with Jalapenos 4.00, Macaroni and Cheese with Bacon 5.50) Add menu options to allow the user to move inventory into a Used Inventory list (for example, to make Macaroni and Cheese with Lobster, the user should move 2 quantity from the blocks of cheese, move 2 from the boxes of Macaroni, and move 1 from the quantity packages of lobster meat. This should add 16 Meals of Macaroni and Cheese with Lobster that can be sold for $7.50 each. The user should be able to sell meals through the application as long as the quantity of meals is greater than zero. At the beginning and end of my food truck shift, I want to run an inventory report (all the items in inventory and the quantity), a summary of the sales, a summary of the cost of Used Inventory. For simplification, we will not charge tax. Add a Meal class. Each Meal has a description and price. (For example, Macaroni and Cheese with Lobster $7.50, Macaroni and Cheese with Jalapenos 4.00, Macaroni and Cheese with Bacon 5.50) Add menu options to allow the user to move inventory into a Used Inventory list (for example, to make Macaroni and Cheese with Lobster, the user should move 2 quantity from the blocks of cheese, move 2 from the boxes of Macaroni, and move 1 from the quantity packages of lobster meat. This should add 16 Meals of Macaroni and Cheese with Lobster that can be sold for $7.50 each. The user should be able to sell meals through the application as long as the quantity of meals is greater than zero. At the beginning and end of my food truck shift, I want to run an inventory report (all the items in inventory and the quantity), a summary of the sales, a summary of the cost of Used Inventory. For simplification, we will not charge tax

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

Step: 3

blur-text-image

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

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions