A shop has a class Bill. Its method total(int amount) simply returns the amount.
During the festival the shop uses a subclass FestivalBill. It overrides total and gives 10 percent off: it returns amount - amount / 10. The division is integer division, so the fraction is dropped.
Write the classes Bill and FestivalBill. The main class is already written. It keeps the object in a Bill variable.
The first line has the bill amount (a whole number, 0 or more). The second line has the word normal or festival.
One line: Pay: followed by the amount to pay.
Input:
500
festival
Output:
Pay: 450

A shop has a class `Bill`. Its method `total(int amount)` simply returns the amount. During the festival the shop uses a subclass `FestivalBill`. It overrides `total` and gives 10 percent off: it returns `amount - amount / 10`. The division is integer division, so the fraction is dropped. Write the classes `Bill` and `FestivalBill`. The main class is already written. It keeps the object in a `Bill` variable. ### Input Format The first line has the bill amount (a whole number, 0 or more). The second line has the word `normal` or `festival`. ### Output Format One line: `Pay: ` followed by the amount to pay. ### Example Input: ``` 500 festival ``` Output: ``` Pay: 450 ``` Write a class `Room` with a constructor `Room(int number)`. Room numbers start with the floor digits: the floor is `number / 100` (integer division). Override `toString` so that printing a room gives: - `Room 204 on floor 2` when the floor is 1 or more, - `Room 15 on the ground floor` when the floor is 0 (the number is below 100). ### Input Format The first line has `n`, the number of rooms. The next `n` lines each have one room number. ### Output Format `n` lines, one for each room, in the same order. ### Example Input: ``` 2 204 15 ``` Output: ``` Room 204 on floor 2 Room 15 on the ground floor ``` Write three classes. - `Vehicle` has a method `wheels()` that returns 4, and a method `describe()` that returns the text `This vehicle has W wheels`, where `W` is the number returned by `wheels()`. - `Bike` is a subclass of `Vehicle`. Its `wheels()` returns 2. - `Auto` is a subclass of `Vehicle`. Its `wheels()` returns 3. Write `describe()` only once, in `Vehicle`. Do not write it again in `Bike` or `Auto`. ### Input Format The first line has `n`. The next `n` lines each have one word: `car`, `bike` or `auto`. A `car` is a plain `Vehicle`. ### Output Format For each word, one line with the result of `describe()`. ### Example Input: ``` 2 car bike ``` Output: ``` This vehicle has 4 wheels This vehicle has 2 wheels ```