Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Answer: See the code below 1. Atlanta class: -----------------------------------

ID: 3920563 • Letter: A

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
    {
        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.

Explanation / Answer

For below code we have considered data as below

inventory.txt(Quantity for each Part number)

250,70,6,30,19

50,200,60,3,16

117,240,78,18,12

113,260,60,20,11

10,20,6,30,12

500,201,160,30,189

transaction.txt(Here P and S as purchase and Sales transaction type respectively while next is part number and then transaction quantity)

S,215,200

P,410,300

P,525,411

S,711,401

P,102,1000

two arrays sale[] and purchase[] will be recording the number of times of sales and purchase of parts for warehouses where each index will correspond to each warehouses(which we have defined as constants in starting).

In case of Sales

First Identify which warehouse has max quantity of parts.

max Function will be used to identify the highest qty warehouse

Supplytxn function will deduct soldquantity from total qty of same warehouse

In case of Purchasetxn

First Identify which warehouse has min quantity of parts.

min Function will be used to identify the lowest qty warehouse

Purchasetxn function will add purchase quantity to total qty of warehouse. Warehouse classes are fine. I am pasting here main class code.

================================================

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace inventorywarehouseprocessing
{
class InventoryWarehouseProcessing
{
public const int numOfWarehouses = 6;
public const int atlantaIn = 0;
public const int baltimoreIn = 1;
public const int chicagoIn = 2;
public const int denverIn = 3;
public const int elyIn = 4;
public const int fargoIn = 5;

//create warehouse objects
public static Atlanta atlantaWarehouse = new Atlanta();
public static Baltimore baltimoreWarehouse = new Baltimore();
public static Chicago chicagoWarehouse = new Chicago();
public static Denver denverWarehouse = new Denver();
public static Ely elyWarehouse = new Ely();
public static Fargo fargoWarehouse = new Fargo();

//creating sale and purchase arrays
//intializing sale and purchase counts for warehouses with 0
public static int[] sale = new int[numOfWarehouses] { 0, 0, 0, 0, 0, 0 };
public static int[] purchase = new int[numOfWarehouses] { 0, 0, 0, 0, 0, 0 };

static void Main(string[] args)
{
  

//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(',');
chicagoWarehouse.part102 = Int32.Parse(parts[0]);
chicagoWarehouse.part205 = Int32.Parse(parts[1]);
chicagoWarehouse.part410 = Int32.Parse(parts[2]);
chicagoWarehouse.part525 = Int32.Parse(parts[3]);
chicagoWarehouse.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:" + chicagoWarehouse.part102 + ",Part 205:" + chicagoWarehouse.part205
+ ",Part 410:" + chicagoWarehouse.part410 + ",Part 525:" + chicagoWarehouse.part525 +
",Part 711:" + chicagoWarehouse.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< transactions.Length; 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
int warehouseIndex = max("102");
//deduct supply amount from that
//console display which warehouse got quantity chnged and updated
saleTxn(warehouseIndex, transactionQuantity, "102");
break;
case "205":
//check which has the largest quantity
warehouseIndex = max("205");
//deduct supply amount from that
//console display which warehouse got quantity chnged and updated
saleTxn(warehouseIndex, transactionQuantity, "205");
break;
case "410":
//check which has the largest quantity
warehouseIndex = max("410");
//deduct supply amount from that
//console display which warehouse got quantity chnged and updated
saleTxn(warehouseIndex, transactionQuantity, "410");
break;
case "525":
//check which has the largest quantity
warehouseIndex = max("525");
//deduct supply amount from that
//console display which warehouse got quantity chnged and updated
saleTxn(warehouseIndex, transactionQuantity, "525");
break;
case "711":
//check which has the largest quantity
warehouseIndex = max("711");
//deduct supply amount from that
//console display which warehouse got quantity chnged and updated
saleTxn(warehouseIndex, transactionQuantity, "711");
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;
}
}

Console.WriteLine("Max sale is from ");
int maxsale = sale.Max();
int maxSaleind = sale.ToList().IndexOf(maxsale);
switch (maxSaleind)
{
case 0:
Console.WriteLine("Atlanta");
break;
case 1:
Console.WriteLine("Baltimore");
break;
case 2:
Console.WriteLine("Chicago");
break;
case 3:
Console.WriteLine("Denver");
break;
case 4:
Console.WriteLine("Ely");
break;
case 5:
Console.WriteLine("Fargo");
break;

}

}

private static void saleTxn(int warehouseIndex, int transactionQuantity, String part)
{
switch (warehouseIndex)
{
case atlantaIn:
switch (part)
{
case "102":
atlantaWarehouse.part102 = atlantaWarehouse.part102 - transactionQuantity;
Console.WriteLine("Part 102 of Atlanta warehouse updated. Remaining qty:"
+ atlantaWarehouse.part102);
break;
case "205":
atlantaWarehouse.part205 = atlantaWarehouse.part205 - transactionQuantity;
Console.WriteLine("Part 205 of Atlanta warehouse updated. Remaining qty:"
+ atlantaWarehouse.part205);
break;
case "410":
atlantaWarehouse.part410 = atlantaWarehouse.part410 - transactionQuantity;
Console.WriteLine("Part 410 of Atlanta warehouse updated. Remaining qty:"
+ atlantaWarehouse.part410);
break;
case "525":
atlantaWarehouse.part525 = atlantaWarehouse.part525 - transactionQuantity;
Console.WriteLine("Part 525 of Atlanta warehouse updated. Remaining qty:"
+ atlantaWarehouse.part525);
break;
case "711":
atlantaWarehouse.part711 = atlantaWarehouse.part711 - transactionQuantity;
Console.WriteLine("Part 711 of Atlanta warehouse updated. Remaining qty:"
+ atlantaWarehouse.part711);
break;
}
sale[atlantaIn] = sale[atlantaIn] + transactionQuantity;
break;
case baltimoreIn:
switch (part)
{
case "102":
baltimoreWarehouse.part102 = baltimoreWarehouse.part102 - transactionQuantity;
Console.WriteLine("Part 102 of baltimore warehouse updated. Remaining qty:"
+ baltimoreWarehouse.part102);
break;
case "205":
baltimoreWarehouse.part205 = baltimoreWarehouse.part205 - transactionQuantity;
Console.WriteLine("Part 205 of baltimore warehouse updated. Remaining qty:"
+ baltimoreWarehouse.part205);
break;
case "410":
baltimoreWarehouse.part410 = baltimoreWarehouse.part410 - transactionQuantity;
Console.WriteLine("Part 410 of baltimore warehouse updated. Remaining qty:"
+ baltimoreWarehouse.part410);
break;
case "525":
baltimoreWarehouse.part525 = baltimoreWarehouse.part525 - transactionQuantity;
Console.WriteLine("Part 525 of baltimore warehouse updated. Remaining qty:"
+ baltimoreWarehouse.part525);
break;
case "711":
baltimoreWarehouse.part711 = baltimoreWarehouse.part711 - transactionQuantity;
Console.WriteLine("Part 711 of baltimore warehouse updated. Remaining qty:"
+ baltimoreWarehouse.part711);
break;
}
sale[baltimoreIn] = sale[baltimoreIn] + transactionQuantity;
break;
case chicagoIn:
switch (part)
{
case "102":
chicagoWarehouse.part102 = chicagoWarehouse.part102 - transactionQuantity;
Console.WriteLine("Part 102 of chicago warehouse updated. Remaining qty:"
+ chicagoWarehouse.part102);
break;
case "205":
chicagoWarehouse.part205 = chicagoWarehouse.part205 - transactionQuantity;
Console.WriteLine("Part 205 of chicago warehouse updated. Remaining qty:"
+ chicagoWarehouse.part205);
break;
case "410":
chicagoWarehouse.part410 = chicagoWarehouse.part410 - transactionQuantity;
Console.WriteLine("Part 410 of chicago warehouse updated. Remaining qty:"
+ chicagoWarehouse.part410);
break;
case "525":
chicagoWarehouse.part525 = chicagoWarehouse.part525 - transactionQuantity;
Console.WriteLine("Part 525 of chicago warehouse updated. Remaining qty:"
+ chicagoWarehouse.part525);
break;
case "711":
chicagoWarehouse.part711 = chicagoWarehouse.part711 - transactionQuantity;
Console.WriteLine("Part 711 of chicago warehouse updated. Remaining qty:"
+ chicagoWarehouse.part711);
break;
}
sale[chicagoIn] = sale[chicagoIn] + transactionQuantity;
break;
case denverIn:
switch (part)
{
case "102":
denverWarehouse.part102 = denverWarehouse.part102 - transactionQuantity;
Console.WriteLine("Part 102 of denver warehouse updated. Remaining qty:"
+ denverWarehouse.part102);
break;
case "205":
denverWarehouse.part205 = denverWarehouse.part205 - transactionQuantity;
Console.WriteLine("Part 205 of denver warehouse updated. Remaining qty:"
+ denverWarehouse.part205);
break;
case "410":
denverWarehouse.part410 = denverWarehouse.part410 - transactionQuantity;
Console.WriteLine("Part 410 of denver warehouse updated. Remaining qty:"
+ denverWarehouse.part410);
break;
case "525":
denverWarehouse.part525 = denverWarehouse.part525 - transactionQuantity;
Console.WriteLine("Part 525 of denver warehouse updated. Remaining qty:"
+ denverWarehouse.part525);
break;
case "711":
denverWarehouse.part711 = denverWarehouse.part711 - transactionQuantity;
Console.WriteLine("Part 711 of denver warehouse updated. Remaining qty:"
+ denverWarehouse.part711);
break;
}
sale[denverIn] = sale[denverIn] + transactionQuantity;
break;
case elyIn:
switch (part)
{
case "102":
elyWarehouse.part102 = elyWarehouse.part102 - transactionQuantity;
Console.WriteLine("Part 102 of ely warehouse updated. Remaining qty:"
+ elyWarehouse.part102);
break;
case "205":
elyWarehouse.part205 = elyWarehouse.part205 - transactionQuantity;
Console.WriteLine("Part 205 of ely warehouse updated. Remaining qty:"
+ elyWarehouse.part205);
break;
case "410":
elyWarehouse.part410 = elyWarehouse.part410 - transactionQuantity;
Console.WriteLine("Part 410 of ely warehouse updated. Remaining qty:"
+ elyWarehouse.part410);
break;
case "525":
elyWarehouse.part525 = elyWarehouse.part525 - transactionQuantity;
Console.WriteLine("Part 525 of ely warehouse updated. Remaining qty:"
+ elyWarehouse.part525);
break;
case "711":
elyWarehouse.part711 = elyWarehouse.part711 - transactionQuantity;
Console.WriteLine("Part 711 of ely warehouse updated. Remaining qty:"
+ elyWarehouse.part711);
break;
}
sale[elyIn] = sale[elyIn] + transactionQuantity;
break;
case fargoIn:
switch (part)
{
case "102":
fargoWarehouse.part102 = fargoWarehouse.part102 - transactionQuantity;
Console.WriteLine("Part 102 of fargo warehouse updated. Remaining qty:"
+ fargoWarehouse.part102);
break;
case "205":
fargoWarehouse.part205 = fargoWarehouse.part205 - transactionQuantity;
Console.WriteLine("Part 205 of fargo warehouse updated. Remaining qty:"
+ fargoWarehouse.part205);
break;
case "410":
fargoWarehouse.part410 = fargoWarehouse.part410 - transactionQuantity;
Console.WriteLine("Part 410 of fargo warehouse updated. Remaining qty:"
+ fargoWarehouse.part410);
break;
case "525":
fargoWarehouse.part525 = fargoWarehouse.part525 - transactionQuantity;
Console.WriteLine("Part 525 of fargo warehouse updated. Remaining qty:"
+ fargoWarehouse.part525);
break;
case "711":
fargoWarehouse.part711 = fargoWarehouse.part711 - transactionQuantity;
Console.WriteLine("Part 711 of fargo warehouse updated. Remaining qty:"
+ fargoWarehouse.part711);
break;
}
sale[fargoIn] = sale[fargoIn] + transactionQuantity;
break;


}
  
}

private static int max(String transactionPartNo)
{
int[] temp = new int[numOfWarehouses];
int maxIndex = 0;
int maxvalue = 0;
switch (transactionPartNo)
{
case "102":
temp[atlantaIn] = atlantaWarehouse.part102;
temp[baltimoreIn] = baltimoreWarehouse.part102;
temp[chicagoIn] = chicagoWarehouse.part102;
temp[denverIn] = denverWarehouse.part102;
temp[elyIn] = elyWarehouse.part102;
temp[fargoIn] = fargoWarehouse.part102;
break;
case "205":
temp[atlantaIn] = atlantaWarehouse.part205;
temp[baltimoreIn] = baltimoreWarehouse.part205;
temp[chicagoIn] = chicagoWarehouse.part205;
temp[denverIn] = denverWarehouse.part205;
temp[elyIn] = elyWarehouse.part205;
temp[fargoIn] = fargoWarehouse.part205;
break;
case "410":
temp[atlantaIn] = atlantaWarehouse.part410;
temp[baltimoreIn] = baltimoreWarehouse.part410;
temp[chicagoIn] = chicagoWarehouse.part410;
temp[denverIn] = denverWarehouse.part410;
temp[elyIn] = elyWarehouse.part410;
temp[fargoIn] = fargoWarehouse.part410;
break;
case "525":
temp[atlantaIn] = atlantaWarehouse.part525;
temp[baltimoreIn] = baltimoreWarehouse.part525;
temp[chicagoIn] = chicagoWarehouse.part525;
temp[denverIn] = denverWarehouse.part525;
temp[elyIn] = elyWarehouse.part525;
temp[fargoIn] = fargoWarehouse.part525;
break;
case "711":
temp[atlantaIn] = atlantaWarehouse.part711;
temp[baltimoreIn] = baltimoreWarehouse.part711;
temp[chicagoIn] = chicagoWarehouse.part711;
temp[denverIn] = denverWarehouse.part711;
temp[elyIn] = elyWarehouse.part711;
temp[fargoIn] = fargoWarehouse.part711;
break;
}

maxvalue = temp.Max();
maxIndex = temp.ToList().IndexOf(maxvalue);

  
return maxIndex;
  

}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote