Design a class RailwayTicket with the following description:
Instance variables/data members:
String name: to store the name of the customer.
String coach: to store the type of coach customer wants to travel.
long mobno: to store customer’s mobile number.
int amt: to store basic amount of ticket.
int totalamt: to store the amount to be paid after updating the original amount.
Methods:
void accept(): to take input for name, coach, mobile number and amount.
void update(): to update the amount as per the coach selected. Extra amount to
be added in the amount as follows:
Type of coaches Amount
First_AC 700
Second_AC 500
Third_AC 250
sleeper None
void display(): To display all details of a customer such as name, coach, total
amount and mobile number.
Write a main() method to create an object of the class and call the above
methods.
PLZZ WRITE THE CODE IN JAVA
ITS URGENT
Answers
Answered by
0
Answer:
urgent is it ik but what will i do now as a amn
Answered by
0
Answer:
https://www.shaalaa.com/question-bank-solutions/design-a-class-railway-ticket-with-following-description-instance-variables-s-data-members-concept-of-string-class_100142
Similar questions