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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!