The Norman Fast-Food restaurant sells the following products (items): Product Pr
ID: 673605 • Letter: T
Question
The Norman Fast-Food restaurant sells the following products (items):
Product
Price ($)
Cheeseburger
2.49
Pepsi
1.00
Chips
0.59
Write the pseudocode for an application that allows a user to enter an order product (item) name (not the item number) 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, display the total price for the order. NOTE: Use the actual product (item) names for input, NOT numbers like 1, 2 and 3 !!! Be sure to use Modules!
Product
Price ($)
Cheeseburger
2.49
Pepsi
1.00
Chips
0.59
Explanation / Answer
Module Module1
Sub Main()
Dim p As String
Console.WriteLine("Enter product name")
p = Console.ReadLine()
If p = "Cheeseburger" Then
Console.WriteLine("Price is 2.49")
ElseIf p = "Pepsi" Then
Console.WriteLine("Price is 1.00")
ElseIf p = "Chips" Then
Console.WriteLine("Price is 0.59")
Else
Console.WriteLine("Sorry, we do not carry that")
End If
End Sub
End Module
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.