Question: Design a class In java RailwayTicket with following description:Instance variables / data members:String nameTo store the name of the customerString coachTo store the type of

Design a class In java RailwayTicket with following description:Instance variables/data members:String nameTo store the name of the customerString coachTo store the type of coach customer wants to travellong mobnoTo store customer 's mobile numberint amtTo store basic amount of ticketint totalamtTo store the amount to be paid after updating the original amountMember methods:void accept 0)void update()To take input for name, coach, mobile number and amount.To update the amount as per the coach selected (extra amount to be added in the amount as follows)Type of CoachesAmountFirst ACSecond ACThird ACSleeper700500250None- To display all details of a customer such as name, coach, total amount and mobile number.void display)Write a main method to create an object of the class and all the above member methods.

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!