Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calculate the Total Payment

Posted on 2013-12-29
4
Medium Priority
?
285 Views
Last Modified: 2014-01-02
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
Comment
Question by:ChiefIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 39

Author Comment

by:ChiefIT
ID: 39745607
good morning and thank you :)
0
 
LVL 19

Accepted Solution

by:
Raheman M. Abdul earned 2000 total points
ID: 39745798
Use  "customer payment+= " wherever there is "customer payment="
And after the while(response = YES); statement print the "customer payment" variable.
0
 
LVL 39

Author Closing Comment

by:ChiefIT
ID: 39752083
Thank you for the support.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question