4. Create a class named HotelRoom that includes an integer field for the room number and a double field for the nightly rental rate. The constructor of this class requires an integer argument representing the room number and the constructor sets the room rate based on the room number; rooms numbered 299 and below are $69.95 per night, and others are $89.95 per night. Create an extended class named Suite whose constructor requires a room number and adds a $40 surcharge to the regular hotel room rate, which again is based on the room number. Write an application named UseHotelRoom that creates an object of each class, accept room number from user, demonstrate that all the methods work correctly and display the details. Save the files as UseHotelRoom.java.
(Tic-Tac-Toe) Create a class Tic-Tac-Toe that will enable you to write a program to play Tic-Tac-Toe. The class contains a private 3-by-3 two-dimensional array. Use an enumeration to represent the value in each cell of the array. The enumeration’s constants should be named X, O and EMPTY (for a position that does not contain an X or an O). The constructor should initialize the board elements to EMPTY. Allow two human players. Wherever the first player moves, place an X in the specified square, and place an O wherever the second player moves. Each move must be to an empty square. After each move, determine whether the game has been won and whether it’s a draw. Also, allow the player to specify whether he or she wants to go first or second.
Imagine a tollbooth at a bridge. Cars passing by the booth are expected to pay a 50
cent toll. Mostly they do, but sometimes a car goes by without paying. T Model this tollbooth with a class called tollbooth. The two data items are a
type unsigned int to hold the total number of cars, and a type double to hold the total
amount of money collected. A constructor initializes both of these to 0. A member
function called payingcar() increments the car total and adds 0.50 to the cash total.
Another function, called nopaycar(), increments the car total but adds nothing to the
cash total. Finally, a member function called display() displays the two totals. Make
appropriate member functions const. Include a program to test this class. This program should allow the user to push one key to count a paying car, and another to count a nonpaying car. Pushing the ESC key should cause the program to print out the total cars and total cash and then exit.
create robot in kotlin Ring the alarm on time Make coffee Heat the water to a suitable temperature Pack your bag (Keep only appropriate books for the day) Cook breakfast and lunch Iron the clothes
Write a program to show the use of static functions and to pass variable length
arguments in a function.
Write a program to display a message in window using Applet class.