This action might not be possible to undo. Are you sure you want to continue?
Define a Java class Worker with the following specification: Data members wno integer wname String hrwrk, wgrate float (hourworked and wage rate per hour) totwage float (hrwrk*wgrate) Member methods calcwg() A method to find hrwrk*wgrate with float return type. in_data() A method to accept values for wno, wname, hrwrk, wgrate and invoke calcwg() to calculate to pay. out_data() A method to display all the data members on the screen. (i) (ii) (iii) Define a class Report with the required specification: Write the code for Calculate Wage buttons click event procedure to operate the class Worker’s method. Write the code for exit button to exit application.
Q2. Define a class Tour in Java with the description given below:
Data members: TCode of type String NoofAdults of type Integer NoofKids of type Integer TotalFare of Type Float Member Methods: A contructor to assign initial values as follows: Tcode with word “NULL” NoofAdults as 0 NoofKids as 0 Kilometers as 0 TotalFare as 0 A method AssignFare() which calculates and assigns the value of the data member TotalFare as follows: For each adult Fare(Rs) For Kilometers 500 >=1000 300 <1000 & >=500 200 <500 For each kid the above Fare will be 50% of the fare mentioned in the above table. A method EnterTour() to input the values of the data members TCode, NoofAdults, NoofKids and Kilometers; and invoke the AssignFare() function. A function ShowFare() which displays the total fare for the tour. (i) Define a class Tour with required specification. (ii) Write the code for Calculate Fare buttons click event procedure to operate the class Tour’s method. (iii) Write the code for Exit button to exit the application. Q3 Define a class Garments in java with the following descriptions: Data Memebers: GCode of type Integer GType GSize of type String of type Integer
A function Display() which displays the garment price.GFabric GPrice of type String of type Float A method Assign() which calculates and assigns the value of GPrice as follows: For the value of GFabric as “COTTON”. A constructor to assign initial values of GCode to 0. GType and GFabric with the word “NOT ALLOWED” and GSize and GPrice with 0. Define a Garments Worker with required specification. . A function Input() to input the values of data members GCode. Write the code for Calculate price button’s click event procedure to operate the class Garment’s method. GSize and GFabric and invoke the Assign() function. GType. GType GPrice(Rs) TROUSER 1300 Member Methods: (i) (ii) (iii) SHIRT 1100 For GFabric other than “COTTON” the above mentioned Gprice gets reduced by 10%. Write the code for Exit button to exit application.