Solved

Calculate the Total Payment

Posted on 2013-12-29
4
265 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
  • 2
4 Comments
 
LVL 38

Author Comment

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

Accepted Solution

by:
Raheman M. Abdul earned 500 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 38

Author Closing Comment

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

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tenRun challenge 28 100
wordsFront challenge 8 90
split53 challenge 7 97
wordappend challenge 8 179
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

810 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