[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 478
  • Last Modified:

C++ booking system

i have created a reservation system and want get to the next level
the system is a cruise ship with three levels. Each level conatins different cabin classes
i have done a 3d array ie cabin[row][column][level] and there is 52 cruises throught out the year
now what i have done works reads,writes [there are 52 text files this was easier with the availability details] etc but now i want to take it further and have the user input a date instead of cruise number (1-52) and need a way or someone to point me in the right direction.
  • 3
1 Solution
George TokasCommented:
The most simple way:
Take as input the date.
Convert it to a number.
April 7 2010 = 04072010
This will be your next data text file.

George Tokas.
bobby101Author Commented:
ok, i have 52 files names roomBooking1.txt ... 52 so do i change the file names to the numeric date?
bobby101Author Commented:
how do i get week number of a given date?
bobby101Author Commented:
so far i have done this:
int week;
 char date[3];
 struct tm tim;
 time_t now;
 now = time(NULL);
 tim = *(localtime(&now));
 week = atoi(date);
 cout << week;
just to get the week number of today but
i want the user to input a date is 19/4/2010
and it picks it up to get the week number, please help!!

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now