Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Calculate the Total Payment

Posted on 2013-12-29
4
Medium Priority
?
290 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
3 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

877 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