A C# program is designed to calculate motel room charges by calling a method with parameters for number of days and room type. The RoomCharge method returns the total charge including 13% HST tax, with single rooms at $100, doubles at $120, and luxury suites at $150 per day. The main program allows users to continuously calculate charges, looping until the user enters N or n to exit.
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Write a C# program to compute the charge for a motel room. This pr.docx
1. Write a C# program to compute the charge for a motel room.
This program is to use a
method called
RoomCharge
with 2 formal parameters: the number of days (an
int
), and the
type of room (a
char
representing ‘S’ or ‘s’ for single, ‘D’ or ‘d’ for double, or ‘L’
or ‘l’ for
luxury suite). The method should compute the charge and return
the value to the Main
method. You can assume a single room is $100, and double
room is $120, and a luxury suite
is $150. Be sure to add 13% HST for the government. All input
is to be done from the main
program. Your main program should also a contain a loop which
allows the user to compute
more than one room charge if they wish (the program should
continue until the user enters a
‘N’ or ‘n’). The method header for should look like:
public static double RoomCharge(int numDays, char roomType)