forked from ashishps1/awesome-low-level-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBooking.cpp
More file actions
24 lines (21 loc) · 1.08 KB
/
Booking.cpp
File metadata and controls
24 lines (21 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "Booking.hpp"
#include <iostream>
#include <iomanip>
Booking::Booking(std::string bookingId, std::string customerName, Concert* concert,
int seatNumber, double totalPrice)
: bookingId(bookingId), customerName(customerName), concert(concert),
seatNumber(seatNumber), totalPrice(totalPrice) {}
std::string Booking::getBookingId() const { return bookingId; }
std::string Booking::getCustomerName() const { return customerName; }
Concert* Booking::getConcert() const { return concert; }
int Booking::getSeatNumber() const { return seatNumber; }
double Booking::getTotalPrice() const { return totalPrice; }
void Booking::displayInfo() const {
std::cout << "\nBooking Details:" << std::endl;
std::cout << "Booking ID: " << bookingId << std::endl;
std::cout << "Customer Name: " << customerName << std::endl;
std::cout << "Seat Number: " << seatNumber << std::endl;
std::cout << "Total Price: $" << std::fixed << std::setprecision(2) << totalPrice << std::endl;
std::cout << "\nConcert Information:" << std::endl;
concert->displayInfo();
}