Write a code fragment to prompt the user to enter the age of the visitor for the concert with the Scanner class. Based on the following table, use the multiple if-else statements to obtain and display the ticket price.

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter6: Sub And Function Procedures
Section: Chapter Questions
Problem 1MQ3
icon
Related questions
Question

basic java code, self-learner here so pls do use more // comments ya if needed

(b) Write a code fragment to prompt the user to enter the age of the visitor for the concert
with the Scanner class. Based on the following table, use the multiple if-else statements
to obtain and display the ticket price.
Age
5-11
12-17
18-49
Above 49
Invalid age
Price
RM 8.00
RM 15.00
RM 20.00
RM 10.00
RM 0.00
Transcribed Image Text:(b) Write a code fragment to prompt the user to enter the age of the visitor for the concert with the Scanner class. Based on the following table, use the multiple if-else statements to obtain and display the ticket price. Age 5-11 12-17 18-49 Above 49 Invalid age Price RM 8.00 RM 15.00 RM 20.00 RM 10.00 RM 0.00
Expert Solution
steps

Step by step

Solved in 4 steps with 6 images

Blurred answer
Knowledge Booster
Types of Expressions
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,