Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 variablesdata 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 void updateTo 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 followsType of CoachesAmountFirst ACSecond ACThird ACSleeperNone To display all details of a customer such as name, coach, total amount and mobile number.void displayWrite 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
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