The Jumpin%u2019 Jive coffee shop charges $2.00 for a cup of coffee and offers t
ID: 3539068 • Letter: T
Question
The Jumpin%u2019 Jive coffee shop charges $2.00 for a cup of coffee and offers the add-ins shown in the table below. Product Price ($) Whipped cream 0.89 Cinnamon 0.25 Chocolate sauce 0.59 Amaretto 1.50 Irish whiskey 1.75 Design the logic for and create an application that allows a user to enter ordered add-ins continuously until a sentinel value is entered. After each item, display its price or the message Sorry, we do not carry that as output. After all items have been entered, output the total price for the order
Please help, I need it in an array
Explanation / Answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
double total = 2;
System.Console.WriteLine("Welcome To Jumpine Jive Coffee Shop");
System.Console.WriteLine("Coffee Charge: $2");
System.Console.WriteLine("Do you want any of the following add-ons:");
int n;
while (true)
{
System.Console.WriteLine("Press 1 Whipped cream for $0.89");
System.Console.WriteLine("Press 2 Cinnamon for $0.25:");
System.Console.WriteLine("Press 3 Chocolate sauce for $0.59:");
System.Console.WriteLine("Press 4 Amaretto for $1.50:");
System.Console.WriteLine("Press 5 Irish whiskey for $1.75");
System.Console.WriteLine("Press 6 Payout");
n = Convert.ToInt16(System.Console.ReadLine());
if (n == 1)
{
total = total + 0.89;
}
else if (n == 2)
{
total = total + 0.25;
}
else if (n == 3)
{
total = total + 0.59;
}
else if (n == 4)
{
total = total + 1.50;
}
else if (n == 5)
{
total = total + 1.75;
}
else if (n == 6)
{
break;
}
else
{
System.Console.WriteLine("Please enter correct value");
}
System.Console.WriteLine("Do you want to add more add ons ?");
}
System.Console.WriteLine("Total Amount to be paid:"+total);
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.