Question 5 This program will calculate the total amount a customer has to pay based on their order of fruit juice. Create a text file as shown below. Name the file as menu.txt. The content of the file represents the juice code, juice name and juice price. menu - Notepad File Edit Format View Help Je01 Apple 2.30 J002 Pineapple 1.90 Je03 Orange 1.70 Je04 Carrot 2.50 Create a FILE pointer called fread. Use this pointer to open the file menu.txt for reading. • Ask the user to enter the juice code and number of glasses. • Identify the price of the juice the customer ordered. • Calculate the total payment and display the bill. • If the joice code entered is wrong, display "The Juice Code is INVALID. Order is cancelled!". • Display the output as shown below. SAMPLE OUTPUT: Enter Juice Code Enter number of glasses : 2 : JO03 Juice : Orange (RM 1.70) Glasses : 2 Payment : RM 3.40

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter4: The Selection Structure
Section: Chapter Questions
Problem 7E
icon
Related questions
Question

This program will calculate the total amount a customer has to pay based on their order  of fruit juice.  

∙ Create a text file as shown below. Name the file as menu.txt. The content of the file  represents the juice code, juice name and juice price

∙ Create a FILE pointer called fread. Use this pointer to open the file menu.txt for  reading. 

∙ Ask the user to enter the juice code and number of glasses. 

∙ Identify the price of the juice the customer ordered. 

∙ Calculate the total payment and display the bill. 

∙ If the joice code entered is wrong, display “The Juice Code is INVALID. Order is  cancelled!”. 

∙ Display the output as shown below.

SAMPLE OUTPUT:

Enter Juice Code : J003 

Enter number of glasses : 2 

Juice : Orange (RM 1.70) 

Glasses : 2 

Payment : RM 3.40

Question 5
This program will calculate the total amount a customer has to pay based on their order
of fruit juice.
• Create a text file as shown below. Name the file as menu.txt. The content of the file
represents the juice code, juice name and juice price.
menu - Notepad
File Edit Format View Help
J001 Apple 2.30
Je02 Pineapple 1.90
J003 Orange 1.70
Je04 Carrot 2.50
Create a FILE pointer called fread. Use this pointer to open the file menu.txt for
reading.
• Ask the user to enter the juice code and number of glasses.
• Identify the price of the juice the customer ordered.
Calculate the total payment and display the bill.
If the joice code entered is wrong, display "The Juice Code is INVALID. Order is
cancelled!".
Display the output as shown below.
SAMPLE OUTPUT:
: JO03
Enter number of glasses : 2
Enter Juice Code
Juice
: Orange (RM 1.70)
Glasses : 2
Payment : RM 3.40
Transcribed Image Text:Question 5 This program will calculate the total amount a customer has to pay based on their order of fruit juice. • Create a text file as shown below. Name the file as menu.txt. The content of the file represents the juice code, juice name and juice price. menu - Notepad File Edit Format View Help J001 Apple 2.30 Je02 Pineapple 1.90 J003 Orange 1.70 Je04 Carrot 2.50 Create a FILE pointer called fread. Use this pointer to open the file menu.txt for reading. • Ask the user to enter the juice code and number of glasses. • Identify the price of the juice the customer ordered. Calculate the total payment and display the bill. If the joice code entered is wrong, display "The Juice Code is INVALID. Order is cancelled!". Display the output as shown below. SAMPLE OUTPUT: : JO03 Enter number of glasses : 2 Enter Juice Code Juice : Orange (RM 1.70) Glasses : 2 Payment : RM 3.40
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT