0% found this document useful (0 votes)
6 views2 pages

Project Program

The document outlines the specifications for a class named 'Hotel' which includes member variables for customer details and methods for inputting data, calculating charges based on the duration of stay, and printing customer information. The billing structure varies based on the number of days stayed, with different rates for the first 3 days, the next 4 days, and any days beyond 7, plus an 18% GST on the total bill. The class is designed to manage hotel customer information and billing effectively.

Uploaded by

papiasaha601
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Project Program

The document outlines the specifications for a class named 'Hotel' which includes member variables for customer details and methods for inputting data, calculating charges based on the duration of stay, and printing customer information. The billing structure varies based on the number of days stayed, with different rates for the first 3 days, the next 4 days, and any days beyond 7, plus an 18% GST on the total bill. The class is designed to manage hotel customer information and billing effectively.

Uploaded by

papiasaha601
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Q1. Define a class with following specifications.

class name: Hotel


Member variables:
String name – stores name of customer name
long mobno – stores mobile number
int days – stores number of days customer stayed in hotel
int bill – stores customer bill
Member method:
void input() – input values using Scanner class methods only
void charge() – calculate bill as per the following criteria

days charge/day

first 3 days 1000 Rs/ day

next 4 days 900 Rs/day

> 7 days 800 Rs/day

bill = bill + gst (18% of bill)


void print() - Display customer name, mobile number and bill.
Q2

Q3

You might also like