Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help on how to use the if and switch statements. Please adhere to the Standards for Programming Assignments and the Java Code and

I need help on how to use the if and switch statements. image text in transcribed
Please adhere to the Standards for Programming Assignments and the Java Code and Style Guidelines. Submit the following .List of source code with comments to document Test output listed as comments at the end of your program 1. CinemaPrice (10 pts). Design and implement an application called CinemaPrice to determine how much a person pays to go the cinema. The program should generate an age from 1 100 using the Random class and prompt the user for the full ticket price. Then display the appropriate ticket price using the currency format from the NumberFormat class (an example in your book). You may want to refer to the example we did together in class to help you with the "if statement. Decide ticket price on the following basis: 1. 2. 3. 4. under 5, free; aged 5 to 12, half price; aged 13 to 54, full price; aged 55, or over, free. Listed below are several different example outputs. Of course, since the age is being generated randomly, your example will be different. Just include one example. I have highlighted the currency format. (your output will not be highlighted) Please enter the cinema ticket price: 12.50 Your age 1 Your ticket price is $0.00 which is free. Please enter the cinema ticket price: 14.75 Your age 47 Your ticket price is $14.75 which is full price

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions