Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Calculate the Total Payment

How to calculate the Total Payment at the end of the code?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string response1, response;
            int superstoreType, department, productType;
            int customerPayment = 0;
            int i = 0;
            int[][, ,] prices = 
            {
                new int [, ,]
                {
                    //Kitchen
                    {{10, 8, 5 }}, 
                    {{30, 16, 88}},
                    //Clothing men, women, kids
                    {{15, 10, 7}}, 
                    {{12, 19, 10}},
                    {{10, 6, 8}},
                    //Cosmetics toiletaries, cosmetics
                    {{5, 3, 6}}, 
                    {{18, 25, 55}},
                    //Sports football, volleyball, basketball
                    {{10, 8, 8,}},   
                    {{8, 10, 3}},
                    {{19, 7, 12}}
                },
                new int [, ,]
                {
                    //Kitchen
                    {{10, 8, 5}}, 
                    {{30, 16, 88}},
                    //Clothing men, women, kids
                    {{15, 10, 7}}, 
                    {{12, 19, 20}},
                    {{10, 6, 8}},
                    //Cosmetics toiletaries, cosmetics
                    {{5, 3, 6,}}, 
                    {{18, 25, 55}},
                }
            };
            string[][, ,] superStore = 
            {
                new string[, ,]
                {
                    //Kitchen
                    {{"Gingko cutlery sets", "Mainstays kitchen scales", "Dishes"}}, 
                    {{"Hamilton Beach juice extractor", "Nostalgia Electrics popcorn maker" , "Paula Deen Cookware set"}},
                    //Clothing men, women, kids
                    {{ "Wrangler Men's jeans", "Edwin Men's shirt", "Hanes Men's long sleeve Tshirt"}}, 
                    {{"Wrangler Men's jacket", "Nike Men's basketball shoes", "Women's dress"}},
                    {{ "Gap Kids' sweatpants", "Kikko Kids' overalls", "Anakku Kids' dresses"}},
                    ////Cosmetics, toiletries
                    {{"Head & Shoulders shampoo", "St Ives facewash", "AXE Men's deodorant"}}, 
                    {{"Paris Hilton Women's fragrance", "Dolce & Gabbana Men's perfume", "Cosmetics"}},
                    ////Sports football, volleyball, basketball
                    {{"Nike football shoes", "Adidas football boots", "Puma football shorts"}},  
                    {{"King basketball jersey", "Nike basketball uniform", "Adidas basketball wristbands"}},
                    {{"Adidas volleyball uniform", "Puma volleyball shoes", "Fido volleyball"}},
                },
                new string[, ,]
                {
                   //Kitchen
                    {{"Gingko cutlery sets", "Mainstays kitchen scales", "Dishes"}}, 
                    {{"Hamilton Beach juice extractor", "Nostalgia Electrics popcorn maker" , "Paula Deen Cookware set"}},
                    //Clothing men, women, kids
                    {{ "Wrangler Men's jeans", "Edwin Men's shirt", "Hanes Men's long sleeve Tshirt"}}, 
                    {{"Wrangler Men's jacket", "Nike Men's basketball shoes", "Women's dress"}},
                    {{ "Gap Kids' sweatpants", "Kikko Kids' overalls", "Anakku Kids' dresses"}},
                    //Cosmetics, toiletries 
                    {{"Head & Shoulders shampoo", "St Ives facewash", "AXE Men's deodorant"}}, 
                    {{"Paris Hilton Women's fragrance", "Dolce & Gabbana Men's perfume", "Cosmetics"}} 
                }
            };

            Console.WriteLine("Welcome to Walmart! \nPlease choose Walmart Superstore(0) or Walmart Superstore Branch(1)");
            superstoreType = int.Parse(Console.ReadLine());
            if (superstoreType == 0)
            {
                Console.WriteLine("Happy shopping in Walmart Superstore!");
                do
                {
                    Console.WriteLine("\nPlease select departments: \nKitchen(0), \nClothes(1), \nCosmetics(2) \nSports(3)");
                    department = int.Parse(Console.ReadLine());
                    switch (department)
                    {
                        case 0:
                            Console.WriteLine("You are in Kitchen department");
                            Console.WriteLine("\nPlease select the product type: \nKitchen cutlery utilities(0) \nKitchen equipment(1)");
                            productType = int.Parse(Console.ReadLine());
                            if (productType == 0)
                            {
                                Console.WriteLine("This is Kitchen cutlery utilities section, please choose the products:");
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][i, j, k] + ": ");
                                        Console.WriteLine(prices[0][i, j, k]);
                                    }
                                }
                                int cutlery = int.Parse(Console.ReadLine());
                                if (cutlery == 0)
                                {
                                    customerPayment = prices[0][0, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (cutlery == 1)
                                {
                                    customerPayment = prices[0][0, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (cutlery == 2)
                                {
                                    customerPayment = prices[0][0, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (cutlery > 2)
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else if (productType == 1)
                            {
                                Console.WriteLine("This is Kitchen equipment section, please choose the products:");
                                int c = i;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.WriteLine(prices[0][c, j, k]);
                                    }
                                }
                                int cultlery = int.Parse(Console.ReadLine());
                                if (cultlery == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (cultlery == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (cultlery == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else
                            {
                                Console.WriteLine("Wrong input");
                            }
                            break;
                        case 1:
                            Console.WriteLine("You are in Clothes department");
                            Console.WriteLine("\nPlease select the product type: \nWomen's clothing(0), \nMen's clothing(1) \nKids clothing(2)");
                            productType = int.Parse(Console.ReadLine());
                            if (productType == 0)
                            {
                                Console.WriteLine("This is Women's clothing section, please choose the products:");
                                int c = i + 1;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int wClothing = int.Parse(Console.ReadLine());
                                if (wClothing == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (wClothing == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (wClothing == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else if (productType == 1)
                            {
                                Console.WriteLine("This is Men's clothing section, please choose the products:");
                                int c = i + 2;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int mClothing = int.Parse(Console.ReadLine());
                                if (mClothing == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (mClothing == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (mClothing == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else if (productType == 2)
                            {
                                Console.WriteLine("Welcome to Kids clothing section, please choose the products:");
                                int c = i + 3;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int kClothing = int.Parse(Console.ReadLine());
                                if (kClothing == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (kClothing == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (kClothing == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else
                            {
                                Console.WriteLine("Wrong input");
                            }
                            break;
                        case 2:
                            Console.WriteLine("You are in Cosmetics department");
                            Console.WriteLine("\nPlease select the product type: \nToiletries(0) \nCosmetics(1)");
                            productType = int.Parse(Console.ReadLine());
                            if (productType == 0)
                            {
                                Console.WriteLine("This is Toiletries section, please choose the products:");
                                int c = i + 4;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int sToiletries = int.Parse(Console.ReadLine());
                                if (sToiletries == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (sToiletries == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (sToiletries == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else if (productType == 1)
                            {
                                Console.WriteLine("This is Cosmetics section, please choose the products:");
                                int c = i + 5;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int sCosmetics = int.Parse(Console.ReadLine());
                                if (sCosmetics == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (sCosmetics == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (sCosmetics == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else
                            {
                                Console.WriteLine("Wrong input");
                            }
                            break;
                        case 3:
                            Console.WriteLine("You are in Sports department");
                            Console.WriteLine("\nPlease select the product type: \nFootball(0) \nBasketball(1) \nVolleyball(2)");
                            productType = int.Parse(Console.ReadLine());
                            if (productType == 0)
                            {
                                Console.WriteLine("This is Football gear section, please choose the products:");
                                int c = i + 6;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int footballGear = int.Parse(Console.ReadLine());
                                if (footballGear == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (footballGear == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (footballGear == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else if (productType == 1)
                            {
                                Console.WriteLine("This is Basketball gear section, please choose the products:");
                                int c = i + 7;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int basketballGear = int.Parse(Console.ReadLine());
                                if (basketballGear == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (basketballGear == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (basketballGear == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else if (productType == 2)
                            {
                                Console.WriteLine("This is Volleyball gear section, please choose the products:");
                                int c = i + 8;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int volleyballGear = int.Parse(Console.ReadLine());
                                if (volleyballGear == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (volleyballGear == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (volleyballGear == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }

                            }
                            else
                            {
                                Console.WriteLine("Wrong input");
                            }
                            break;
                    }
                    Console.Write("Would you like to continue shopping with us? Yes/No: ");
                    response = Console.ReadLine().ToUpper();
                } while (response == "YES");
            }
            else if (superstoreType == 1)
            {
                Console.WriteLine("Happy shopping in Walmart Superstore branch!");
                do
                {
                    Console.WriteLine("\nPlease select the departments: \nKitchen(0), \nClothes(1) \nCosmetics(2)");
                    department = int.Parse(Console.ReadLine());
                    switch (department)
                    {
                        case 0:
                            Console.WriteLine("You are in Kitchen department");
                            Console.WriteLine("\nPlease select the product type: \nKitchen cutlery utilities(0) \nKitchen equipment(1)");
                            productType = int.Parse(Console.ReadLine());
                            if (productType == 0)
                            {
                                Console.WriteLine("This is Kitchen cutlery utilities section, please choose the products:");
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][i, j, k] + ": ");
                                        Console.WriteLine(prices[0][i, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int cultlery = int.Parse(Console.ReadLine());
                                if (cultlery == 0)
                                {
                                    customerPayment = prices[0][0, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (cultlery == 1)
                                {
                                    customerPayment = prices[0][0, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (cultlery == 2)
                                {
                                    customerPayment = prices[0][0, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }

                            }
                            else if (productType == 1)
                            {
                                Console.WriteLine("This is Kitchen equipment section, please choose the products:");
                                int c = i;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.WriteLine(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int cultlery = int.Parse(Console.ReadLine());
                                if (cultlery == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (cultlery == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (cultlery == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else
                            {
                                Console.WriteLine("Wrong input");
                            }
                            break;
                        case 1:
                            Console.WriteLine("You are in Clothes department");
                            Console.WriteLine("\nPlease select the product type: \nWomen's clothing(0), \nMen's clothing(1) \nKids' clothing(2)");
                            productType = int.Parse(Console.ReadLine());
                            if (productType == 0)
                            {
                                Console.WriteLine("This is Women's clothing section, please choose the products:");
                                int c = i + 1;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int wClothing = int.Parse(Console.ReadLine());
                                if (wClothing == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (wClothing == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (wClothing == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else if (productType == 1)
                            {
                                Console.WriteLine("This is Men's clothing section, please choose the products:");
                                int c = i + 2;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int mClothing = int.Parse(Console.ReadLine());
                                if (mClothing == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (mClothing == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (mClothing == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else if (productType == 2)
                            {
                                Console.WriteLine("Welcome to Kids' clothing section, please choose the products:");
                                int c = i + 3;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int kClothing = int.Parse(Console.ReadLine());
                                if (kClothing == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (kClothing == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (kClothing == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else
                            {
                                Console.WriteLine("Wrong input");
                            }
                            break;
                        case 2:
                            Console.WriteLine("You are in Cosmetics department");
                            Console.WriteLine("\nPlease select the product type: \nToiletries(0) \nCosmetics(1)");
                            productType = int.Parse(Console.ReadLine());
                            if (productType == 0)
                            {
                                Console.WriteLine("This is Toiletries section, please choose the products:");
                                int c = i + 4;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int sToileteries = int.Parse(Console.ReadLine());
                                if (sToileteries == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (sToileteries == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (sToileteries == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else if (productType == 1)
                            {
                                Console.WriteLine("This is Cosmetics section, please choose the products:");
                                int c = i + 5;
                                c++;
                                for (int j = 0; j < 1; j++)
                                {
                                    for (int k = 0; k < 3; k++)
                                    {
                                        Console.Write(k + " " + superStore[0][c, j, k] + ": ");
                                        Console.Write(prices[0][c, j, k]);
                                        Console.WriteLine();
                                    }
                                }
                                int sCosmetics = int.Parse(Console.ReadLine());
                                if (sCosmetics == 0)
                                {
                                    customerPayment = prices[0][c, 0, 0];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (sCosmetics == 1)
                                {
                                    customerPayment = prices[0][c, 0, 1];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else if (sCosmetics == 2)
                                {
                                    customerPayment = prices[0][c, 0, 2];
                                    Console.WriteLine("\nYour payment is: " + customerPayment);
                                }
                                else
                                {
                                    Console.WriteLine("\nIncorrect product choice!");
                                }
                            }
                            else
                            {
                                Console.WriteLine("Wrong input");
                            }
                            break;
                    }
                    Console.Write("Would you like to continue shopping with us? Yes/No: ");
                    response1 = Console.ReadLine().ToUpper();
                } while (response1 == "YES");

            }

        }
    }
}

Open in new window

0
ChiefIT
Asked:
ChiefIT
  • 2
1 Solution
 
ChiefITAuthor Commented:
good morning and thank you :)
0
 
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
Use  "customer payment+= " wherever there is "customer payment="
And after the while(response = YES); statement print the "customer payment" variable.
0
 
ChiefITAuthor Commented:
Thank you for the support.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now