Here's a simple C++ program for hotel billing:
#include <iostream>
#include <string>
using namespace std;
class HotelBilling {
private:
string customerName;
int roomNumber;
int numberOfDays;
double roomRate;
double foodBill;
double totalBill;
public:
void inputDetails() {
cout << "Enter customer name: ";
getline(cin, customerName);
cout << "Enter room number: ";
cin >> roomNumber;
cout << "Enter number of days stayed: ";
cin >> numberOfDays;
cout << "Enter room rate per day: ";
cin >> roomRate;
cout << "Enter food bill: ";
cin >> foodBill;
}
void calculateBill() {
totalBill = (roomRate * numberOfDays) + foodBill;
}
void displayBill() {
cout << "\nHotel Bill\n";
cout << "Customer Name: " << customerName << endl;
cout << "Room Number: " << roomNumber << endl;
cout << "Number of Days Stayed: " << numberOfDays << endl;
cout << "Room Rate per Day: " << roomRate << endl;
cout << "Food Bill: " << foodBill << endl;
cout << "Total Bill: " << totalBill << endl;
}
};
int main() {
HotelBilling billing;
billing.inputDetails();
billing.calculateBill();
billing.displayBill();
return 0;
}

