import java.io.* /* Class Movie Cost Author: Date: Description: Sponge Bob Sept. 2007 Calculates the cost of a movie based on the input from the user. */ public class Movie Cost ( public static void main(String args[]) throws Exception { Buffered Reader kb = new Buffered Reader(new InputStreamReader(System.in)); // input show time from the keyboard System.out.print ("Please enter the time of show: ('M' for Matinee or 'E' for Evening) char showTime=kb.readLine().charAt(0); // input input ticket type from the keyboard System.out.print("Please enter the type of ticket: ('C' for Child or 'A' for Adult): "); char ticketType = Integer.parseInt(readLine()); // calculate the cost of the ticket double ticketCost = cale Ticket Cost( showTime, ticketType); // output the cost of the ticket System.out.println("The cost of your ticket is " + ticket Cost); } // main method /" method to calculate the cost of a movie ticket given the show time and ticket type */ public static int caleTicketCost (char showTime, String ticketType) 1 double ticket Cost=0; // initialize the cost to 0 if (showTime=='M' && ticketType == 'C') ticketCost = 4.50; if (show Time == 'E' && ticketType == 'C') ticketCost = 5.50; if (showTime='M' && ticketType == 'A') ticketCost = 8.00; if (showTime='E' && ticketType=='A') ticketCost = 10.50; return ticketCost; // cale TicketCost method } // MovieCost class
import java.io.* /* Class Movie Cost Author: Date: Description: Sponge Bob Sept. 2007 Calculates the cost of a movie based on the input from the user. */ public class Movie Cost ( public static void main(String args[]) throws Exception { Buffered Reader kb = new Buffered Reader(new InputStreamReader(System.in)); // input show time from the keyboard System.out.print ("Please enter the time of show: ('M' for Matinee or 'E' for Evening) char showTime=kb.readLine().charAt(0); // input input ticket type from the keyboard System.out.print("Please enter the type of ticket: ('C' for Child or 'A' for Adult): "); char ticketType = Integer.parseInt(readLine()); // calculate the cost of the ticket double ticketCost = cale Ticket Cost( showTime, ticketType); // output the cost of the ticket System.out.println("The cost of your ticket is " + ticket Cost); } // main method /" method to calculate the cost of a movie ticket given the show time and ticket type */ public static int caleTicketCost (char showTime, String ticketType) 1 double ticket Cost=0; // initialize the cost to 0 if (showTime=='M' && ticketType == 'C') ticketCost = 4.50; if (show Time == 'E' && ticketType == 'C') ticketCost = 5.50; if (showTime='M' && ticketType == 'A') ticketCost = 8.00; if (showTime='E' && ticketType=='A') ticketCost = 10.50; return ticketCost; // cale TicketCost method } // MovieCost class
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Please help me with this. Programming language being used is java
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY