Question
I only want to use your perfect code to check my code please use java Compute and display the price a person will pay for
I only want to use your perfect code to check my code
please use java
Compute and display the price a person will pay for one train ticket to get from town X to town Y according to the following rules.
If the ticket is bought at the train station ticket counter or at the automatic ticket counter:
an adult pays $11.50
a senior pays $6.50 If ticket is bought inside the train there is an extra charge of 10% of the total price.
READ is the person a senior? READ does the person bought ticket onboard the train? IF person is a senior THEN
SET price to 6.50 ELSE
SET price to 11.50 ENDIF
IF person buys inside the train THEN COMPUTE price as price * 1.10
ENDIF DISPLAY price
Assume no error on input.
You must use the IO module to read inputs and to output your answer.
DO NOT add any import statements to TrainTicket.java
DO NOT change the headers of ANY of the given methods
DO NOT use System.exit()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started