So I'm a total beginner in programming and I don't have any idea how this works. But this is probably the easiest thing being asked. So I want to create a program where you sell things and stuff. The customer is being lead to a menu in which where he/she will select a thing to buy. Every product has its specified letter for the user to enter. So what I want to know is, how do you assign values to identifiers using array and call them when the customer chooses a corresponding letter?
Like for example, [A]Product 1 [B]Product 2
The customer inputs A so product 1 will be called and along with it is the product's price. Then using the 'do-while' loop, the program will then ask if the customer wants to have another transaction and if the customer chooses YES, the program will then repeat, and the customer chooses, and the price of the new item will be added to older one. Like: Product 1 + Product 2 = Total Price
Then if the customer chooses NO, it will print a receipt with the items bought, the amount and the total. Please help me. If it's not for the array, maybe I can do this, but yeah. :(
Thanks. Btw, if you want to see my code, here it is. This is just the design though just to give you an idea. Thanks again! I hope you can help me. Please.
string ans;
do
{
switch(group)
{
case "S":
case "s":
Console.WriteLine("***************************************************************");
Console.WriteLine("* SHINee *");
Console.WriteLine("***************************************************************");
Console.WriteLine("* Items: * Bundles for Concert *");
Console.WriteLine("* | Lanyards/Lace P200 * [O]BUNDLE 1 P450 *");
Console.WriteLine("* [A]Onew * T-SHIRT(Free Size) *");
Console.WriteLine("* [B]Jonghyun * Lightstick *");
Console.WriteLine("* [C]Minho * Banner *");
Console.WriteLine("* [D]Key * *");
Console.WriteLine("* [E]Taemin * [P]BUNDLE 2 P590 *");
Console.WriteLine("* * T-SHIRT(Free Size) *");
Console.WriteLine("* | Bag Tag P60 * 2 Lighsticks *");
Console.WriteLine("* [G]Onew * Banner *");
Console.WriteLine("* [H]Jonghyun * *");
Console.WriteLine("* [I]Minho * [Q]BUNDLE 3 P720 *");
Console.WriteLine("* [J]Key * T-SHIRT(Free Size) *");
Console.WriteLine("* [K]Taemin * 2 Lighsticks *");
Console.WriteLine("* * Banner *");
Console.WriteLine("* | Couple Keychain P90 * Balloon *");
Console.WriteLine("* [M]2Min * *");
Console.WriteLine("* [N]JongKey * *");
Console.WriteLine("* * *");
Console.WriteLine("* * *");
Console.WriteLine("***************************************************************");
Console.WriteLine("");
Console.WriteLine("==========================");
Console.Write("Input letter of choice: ");
string merchshin = Console.ReadLine();
break;
}
Console.Write("Do you want to do another transaction?");
ans = Console.ReadLine();
Console.WriteLine("==========================");
Console.Clear();
}
while (ans == "y" || ans == "Y");
Console.ReadLine();