Question: Answer: See the code below 1. Atlanta class: ----------------------------------------- using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace inventorywarehouseprocessing { class Atlanta {
Answer: See the code below
1. Atlanta class:
-----------------------------------------
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace inventorywarehouseprocessing { class Atlanta { public int part102; public int part205; public int part410; public int part525; public int part711; } }
---------------------------------
2. Baltimore class:
-----------------------------------
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace inventorywarehouseprocessing { class Baltimore { public int part102; public int part205; public int part410; public int part525; public int part711; } }
-----------------------------------
3. Chicago class:
----------------------------------------
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace inventorywarehouseprocessing { class Chicago { public int part102; public int part205; public int part410; public int part525; public int part711; } }
-------------------------------------------
4. Denver class:
--------------------------------------
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace inventorywarehouseprocessing { class Denver { public int part102; public int part205; public int part410; public int part525; public int part711; } }
--------------------------------------
5. Ely class:
-----------------------------------------
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace inventorywarehouseprocessing { class Ely { public int part102; public int part205; public int part410; public int part525; public int part711; } }
--------------------------------------------
6. Fargo class:
----------------------------------------
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace inventorywarehouseprocessing { class Fargo { public int part102; public int part205; public int part410; public int part525; public int part711; } }
------------------------------------------
7. InventoryWarehouseProcessing class:
-----------------------------------------
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO;
namespace inventorywarehouseprocessing { class InventoryWarehouseProcessing { static void Main(string[] args) { //create warehouse objects Atlanta atlantaWarehouse = new Atlanta(); Baltimore baltimoreWarehouse = new Baltimore(); Chicago chigagoWarehouse = new Chicago(); Denver denverWarehouse = new Denver(); Ely elyWarehouse = new Ely(); Fargo fargoWarehouse = new Fargo();
//read inventory file line by line String inventoryFileName = "Inventory.txt"; String[] lines = File.ReadAllLines(inventoryFileName, Encoding.UTF8); //populate Atlanta warehouse string[] parts = lines[0].Split(','); atlantaWarehouse.part102 = Int32.Parse(parts[0]); atlantaWarehouse.part205 = Int32.Parse(parts[1]); atlantaWarehouse.part410 = Int32.Parse(parts[2]); atlantaWarehouse.part525 = Int32.Parse(parts[3]); atlantaWarehouse.part711 = Int32.Parse(parts[4]); //populate Baltimore warehouse parts = lines[1].Split(','); baltimoreWarehouse.part102 = Int32.Parse(parts[0]); baltimoreWarehouse.part205 = Int32.Parse(parts[1]); baltimoreWarehouse.part410 = Int32.Parse(parts[2]); baltimoreWarehouse.part525 = Int32.Parse(parts[3]); baltimoreWarehouse.part711 = Int32.Parse(parts[4]); //populate Chicago warehouse parts = lines[2].Split(','); chigagoWarehouse.part102 = Int32.Parse(parts[0]); chigagoWarehouse.part205 = Int32.Parse(parts[1]); chigagoWarehouse.part410 = Int32.Parse(parts[2]); chigagoWarehouse.part525 = Int32.Parse(parts[3]); chigagoWarehouse.part711 = Int32.Parse(parts[4]); //populate Denver warehouse parts = lines[3].Split(','); denverWarehouse.part102 = Int32.Parse(parts[0]); denverWarehouse.part205 = Int32.Parse(parts[1]); denverWarehouse.part410 = Int32.Parse(parts[2]); denverWarehouse.part525 = Int32.Parse(parts[3]); denverWarehouse.part711 = Int32.Parse(parts[4]); //populate Ely warehouse parts = lines[4].Split(','); elyWarehouse.part102 = Int32.Parse(parts[0]); elyWarehouse.part205 = Int32.Parse(parts[1]); elyWarehouse.part410 = Int32.Parse(parts[2]); elyWarehouse.part525 = Int32.Parse(parts[3]); elyWarehouse.part711 = Int32.Parse(parts[4]); //populate Fargo warehouse parts = lines[5].Split(','); fargoWarehouse.part102 = Int32.Parse(parts[0]); fargoWarehouse.part205 = Int32.Parse(parts[1]); fargoWarehouse.part410 = Int32.Parse(parts[2]); fargoWarehouse.part525 = Int32.Parse(parts[3]); fargoWarehouse.part711 = Int32.Parse(parts[4]);
Console.WriteLine("Status of warehouses at the beginning of the day:"); Console.WriteLine("Atlanta warehouse:"); Console.WriteLine("Part 102:" + atlantaWarehouse.part102 + ",Part 205:" + atlantaWarehouse.part205 + ",Part 410:" + atlantaWarehouse.part410 + ",Part 525:" + atlantaWarehouse.part525 + ",Part 711:" + atlantaWarehouse.part711); Console.WriteLine("Baltimore warehouse:"); Console.WriteLine("Part 102:" + baltimoreWarehouse.part102 + ",Part 205:" + baltimoreWarehouse.part205 + ",Part 410:" + baltimoreWarehouse.part410 + ",Part 525:" + baltimoreWarehouse.part525 + ",Part 711:" + baltimoreWarehouse.part711); Console.WriteLine("Chicago warehouse:"); Console.WriteLine("Part 102:" + chigagoWarehouse.part102 + ",Part 205:" + chigagoWarehouse.part205 + ",Part 410:" + chigagoWarehouse.part410 + ",Part 525:" + chigagoWarehouse.part525 + ",Part 711:" + chigagoWarehouse.part711); Console.WriteLine("Denver warehouse:"); Console.WriteLine("Part 102:" + denverWarehouse.part102 + ",Part 205:" + denverWarehouse.part205 + ",Part 410:" + denverWarehouse.part410 + ",Part 525:" + denverWarehouse.part525 + ",Part 711:" + denverWarehouse.part711); Console.WriteLine("Ely warehouse:"); Console.WriteLine("Part 102:" + elyWarehouse.part102 + ",Part 205:" + elyWarehouse.part205 + ",Part 410:" + elyWarehouse.part410 + ",Part 525:" + elyWarehouse.part525 + ",Part 711:" + elyWarehouse.part711); Console.WriteLine("Fargo warehouse:"); Console.WriteLine("Part 102:" + fargoWarehouse.part102 + ",Part 205:" + fargoWarehouse.part205 + ",Part 410:" + fargoWarehouse.part410 + ",Part 525:" + fargoWarehouse.part525 + ",Part 711:" + fargoWarehouse.part711);
String transactionsFileName = "Transactions.txt"; //read transactions file String[] transactions = File.ReadAllLines(transactionsFileName, Encoding.UTF8); //process transactions for(int i=0;i { String transaction = transactions[i]; String[] transactionData = transaction.Split(','); String transactionType = transactionData[0]; String transactionPartNo = transactionData[1]; int transactionQuantity = Int32.Parse(transactionData[2]); switch(transactionType) { case "S": switch(transactionPartNo) { case "102": //check which has the largest quantity break; case "205": //check which has the largest quantity break; case "410": //check which has the largest quantity break; case "525": //check which has the largest quantity break; case "711": //check which has the largest quantity break; } break; case "P": switch (transactionPartNo) { case "102": //check which has the lowest quantity
break; case "205": //check which has the lowest quantity break; case "410": //check which has the lowest quantity break; case "525": //check which has the lowest quantity break; case "711": //check which has the lowest quantity break; } break; } } } } }
------------------------------------------------------------
fix the code. function not working. But not printing the sell and purchase value.
code in visual studio.
display both highest sale warehouse and lowest purchase warehouse.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
