Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

More Books

Students also viewed these Databases questions

Question

3. Who will ultimately pay for this type of practice?

Answered: 1 week ago