Answered step by step
Verified Expert Solution
Link Copied!

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 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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

Fill in the missing values. 17.3 kg = _______ hg

Answered: 1 week ago