Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Design a class 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

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

Sketch two- transistor model of the SCR and explain its working

Answered: 1 week ago