Consider the following Java program, which is intended to display the cost of a cinema ticket. Part of the code has been replaced by a comment: import java.util.Scanner; public class CinemaTicket {...

Consider the following Java program, which is intended to display the cost of a cinema ticket. Part of the code has been replaced by a comment: import java.util.Scanner; public class CinemaTicket { public static void main(String[] args) { double price = 10.00; int age; Scanner keyboard = new Scanner(System.in); System.out.print("Enter your age: "); age = keyboard.nextInt(); // code to reduce ticket price for children goes here System.out.println("Ticket price = " + price); } } Replace the comment so that children under the age of 14 get half price tickets.

May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here