A bus company stores each ticket as an object. The Ticket class already has two private fields and a constructor. Add the three methods that main uses.
getPassenger() returns the passenger name.getFare() returns the fare.totalFare() returns the fare plus 5 percent GST. Use whole-number (integer) arithmetic: GST is fare * 5 / 100, and any fraction is dropped.One line with the passenger name (one word) and the fare (a whole number, 0 or more).
Three lines: Passenger: <name>, Fare: <fare> and Total: <total fare>.
Input: Meera 250
Output:
Passenger: Meera
Fare: 250
Total: 262

A bus company stores each ticket as an object. The `Ticket` class already has two private fields and a constructor. Add the three methods that `main` uses. - `getPassenger()` returns the passenger name. - `getFare()` returns the fare. - `totalFare()` returns the fare plus 5 percent GST. Use whole-number (integer) arithmetic: GST is `fare * 5 / 100`, and any fraction is dropped. ### Input Format One line with the passenger name (one word) and the fare (a whole number, 0 or more). ### Output Format Three lines: `Passenger: <name>`, `Fare: <fare>` and `Total: <total fare>`. ### Example Input: `Meera 250` Output: ``` Passenger: Meera Fare: 250 Total: 262 ``` The `Room` class stores the length and the width of a classroom floor, both whole numbers. Write the three methods used by `main`. - `area()` returns length times width. - `perimeter()` returns `2 * (length + width)`. - `isSquare()` returns `true` when length and width are equal, otherwise `false`. ### Input Format One line with the length and the width (both 1 or more). ### Output Format Three lines: `Area: <area>`, `Perimeter: <perimeter>` and `Square: yes` or `Square: no`. ### Example Input: `4 6` Output: ``` Area: 24 Perimeter: 20 Square: no ``` A club wants to know how many `Member` objects have been created in total. Every object has its own `name`, but the count belongs to the class, so it must be `static`. Write the missing code in `Member`. - A `private static int` counter that starts at 0. - The constructor must add 1 to the counter each time a member is created. - A `static` method `getTotal()` that returns the counter. ### Input Format The first line has a whole number `n` (0 or more). The second line has `n` names, each one word, separated by spaces. When `n` is 0 the second line is missing. ### Output Format For each name print `Welcome <name>` on its own line, in the same order. Then print `Total members: <n>`. ### Example Input: ``` 3 Asha Ravi Meena ``` Output: ``` Welcome Asha Welcome Ravi Welcome Meena Total members: 3 ```