Hi guys, I need to write a c++ program which i will mention below. I have only manage to start on the structures and do not know how to continue, been searching for possible examples but couldn't find any. Below is what I need to do:
I need to use a loop to prompt the user to enter the reservation date.
If the user enters “E”, the loop terminates, otherwise it invokes the function, findBBQ(). If the returned BBQNumber is 0, it means there is no available BBQ pit on the selected date.
Display the message, “No available BBQ pit on selected date, please re-enter another date or 'E' to exit.”
If there is a pit available for booking, prompt the user to enter ID, name, address and fees and invoke the function, bookBBQ() to book the pit, setting the booking_details and pit of booking, including setting the data field, available to false.
I know how to make the program close once 'E' is entered, I know how to get the user to enter the reservation date, but how do i make a particular date available or not available? Not sure how to code this part? Just need a guide in the right direction. Thanks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Pstruct BBQ
{
int BBQNumber; // Pit Number
string cal_date; // calendar date
bool available; // status of pit - true if available for booking
};
struct Details
{
string ID; // Booking ID
string name; // Name of resident
string addr; // Address of resident
string rdate; // Reservation date of pit
double fees; // $$ charged for the pit
};
struct Booking
{
Details booking_details;
BBQ pit;
};
const int SIZE = 3;
Booking b; // Booking of pit
BBQ pits[365][SIZE];
|