Adrian MT
Adrian MT
CC#
Created by Adrian MT on 9/26/2023 in #help
❔ Making a Vending Machine for Class!
I'm still learning quite a bit! We've really only had 5 modules of into to work with! I really do appreciate your help 🙂
30 replies
CC#
Created by Adrian MT on 9/26/2023 in #help
❔ Making a Vending Machine for Class!
I think so, I'm looking at my code and this now, thank you!
30 replies
CC#
Created by Adrian MT on 9/26/2023 in #help
❔ Making a Vending Machine for Class!
Yeah! That's what I'm having trouble with
30 replies
CC#
Created by Adrian MT on 9/26/2023 in #help
❔ Making a Vending Machine for Class!
namespace Homework5
{
internal class Program
{
static void Main(string[] args)
{
double vendingOne = 1;
double vendingTwo = 2;
double vendingThree = 1.5;
double sodaQuantity = 0;
double cookieQuantity = 0;
double chipQuantity = 0;

double totalOne = (sodaQuantity*vendingOne);
double totalTwo = (cookieQuantity*vendingTwo);
double totalThree = (chipQuantity*vendingThree);

while (true)
{
Console.WriteLine(" OSU Snacks menu");
Console.WriteLine("Select 1 for Soda --> price = $" + vendingOne);
Console.WriteLine("Select 2 for Cookie --> price = $" + vendingTwo);
Console.WriteLine("Select 3 for Chips --> price = $" + vendingThree);
Console.WriteLine();
string userInput = Console.ReadLine();
double numberSelect = Convert.ToDouble(userInput);

if (numberSelect == 1)
{
Console.WriteLine("You chose soda. How many do you want?");
string quantitySelect = Console.ReadLine();
double qsoda = Convert.ToDouble(quantitySelect);
sodaQuantity += (int)qsoda;
Console.WriteLine("Press y if that is all for today");
string yesNo = Console.ReadLine();
if (yesNo == "n")

continue;

if (yesNo == "y")
{
Console.WriteLine("Your total is $" + sodaQuantity*vendingOne);
Console.WriteLine();
break;
}
namespace Homework5
{
internal class Program
{
static void Main(string[] args)
{
double vendingOne = 1;
double vendingTwo = 2;
double vendingThree = 1.5;
double sodaQuantity = 0;
double cookieQuantity = 0;
double chipQuantity = 0;

double totalOne = (sodaQuantity*vendingOne);
double totalTwo = (cookieQuantity*vendingTwo);
double totalThree = (chipQuantity*vendingThree);

while (true)
{
Console.WriteLine(" OSU Snacks menu");
Console.WriteLine("Select 1 for Soda --> price = $" + vendingOne);
Console.WriteLine("Select 2 for Cookie --> price = $" + vendingTwo);
Console.WriteLine("Select 3 for Chips --> price = $" + vendingThree);
Console.WriteLine();
string userInput = Console.ReadLine();
double numberSelect = Convert.ToDouble(userInput);

if (numberSelect == 1)
{
Console.WriteLine("You chose soda. How many do you want?");
string quantitySelect = Console.ReadLine();
double qsoda = Convert.ToDouble(quantitySelect);
sodaQuantity += (int)qsoda;
Console.WriteLine("Press y if that is all for today");
string yesNo = Console.ReadLine();
if (yesNo == "n")

continue;

if (yesNo == "y")
{
Console.WriteLine("Your total is $" + sodaQuantity*vendingOne);
Console.WriteLine();
break;
}
30 replies
CC#
Created by Adrian MT on 9/26/2023 in #help
❔ Making a Vending Machine for Class!
Give me one sec
30 replies
CC#
Created by Adrian MT on 9/26/2023 in #help
❔ Making a Vending Machine for Class!
Yes. How do I do what you did?
30 replies