Solved

Calculate the Total Payment

Posted on 2013-12-29
4
258 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ShiftLeft challenge 21 66
count7 challenge 12 70
Problem to event 3 50
recursion example 16 69
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

757 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now