Define a class RailwayTicket with 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 customers mobile number int amt : to store basic amount of ticket int totalamt : to store the amount to be paid after updating the original amount Member Methods : RailwayTicket( ) - default constructor to initialize the data members with default values. 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 the main method to create an object of the class and call the above member methods.
Answers
Hello!
✍️The main() method is the entry point into the application.
✍️The signature of the method is always: public static void main(String[] args)
✍️Command-line arguments are passed through the args parameter, which is an array of String s.
Thanks!❤
Define a class RESORT in C++ with the following description :
Private members:
Rno //Data member to store Room No
Name //Data member top store customer name
Charges //Data member to store per day charges
Days //Data member to store number of days of stay
Compute() //A function to calculate & return Amount as Days*charges and if the value of
Days*Charges is more than 11000 then as 1.02*Days*Charges
Public members:
Getinfo() //A function to enter the content Rno, Name, Charges and Days
Disinfo() // A amount to display Rno,Name,Charges,Days and Amount
(Amount to be displayed by calling function COMPUTE()