very stuck please help!

This is a discussion on very stuck please help! within the C++ Programming forums, part of the General Programming Boards category; ok, i need to finish my computing coursework by wednesday. all i need to finish is the usage stats. but ...

  1. #1
    dac
    dac is offline
    Registered User
    Join Date
    Jan 2006
    Location
    North Yorkshire, England
    Posts
    147

    very stuck please help!

    ok, i need to finish my computing coursework by wednesday. all i need to finish is the usage stats. but im stuck here goes;
    i have my bookings stucture as
    Code:
    struct booking
    {
            int booker_id;
            int week, day, time;
            int event_title;
            int fee_owed;
    }
    
    bookings booking[50];
    its for a village hall booking program btw dancing, oragami etc.

    i have 1 - 9 representing the 9 weeks in 2 months.
    1 - 6 representing the number of days (not open sunday)
    and 1 - 4 representing the 4 different time zones allowed to book.

    now i need to work out a percentage statistics for each weekly slot usage. how can i do it!!!
    ive been trying swich statements but the code just ends up redicuroulsy big, and not sure how a for loop would work.
    any help would be much appreciated, just ask if your not sure of the stucture.
    thanks in advance dac.
    Last edited by dac; 05-06-2006 at 10:20 AM.

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    There are more then eight weeks in 2 months unless you have two Februarys in 2 months.
    Last edited by bumfluff; 05-06-2006 at 10:21 AM.

  3. #3
    dac
    dac is offline
    Registered User
    Join Date
    Jan 2006
    Location
    North Yorkshire, England
    Posts
    147
    thanks for that. it needs to be for jan and feb. will edit the post.

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    Right so that is excluding a leap year....31+28 days which is 7 and a tiny bit weeks.

    Well do you mean that you have 4 slots per day?

    So that is 24 slots per week.

    So say you use 10 slots...that would be 41.66666666666% of your weekly usage.

  5. #5
    dac
    dac is offline
    Registered User
    Join Date
    Jan 2006
    Location
    North Yorkshire, England
    Posts
    147
    no sorry, there is 6 days you can book a week mon - sat.
    and 4 daily time slots like 9am to 10.30pm, 11pm to 1.30pm etc.
    when people book they all dont book every slot of every day, some will book mon period 1 another tuesday period 2 etc.

  6. #6
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    Yes...and you want to know the percentage used out of the amount available per week?

  7. #7
    dac
    dac is offline
    Registered User
    Join Date
    Jan 2006
    Location
    North Yorkshire, England
    Posts
    147
    yes but it has to be for each weekly time slot so mon period 1 43% tues period 2 53% etc.
    but for over 2 months.

  8. #8
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    Do you mean the percentages of mondays that you are using up or what?

  9. #9
    dac
    dac is offline
    Registered User
    Join Date
    Jan 2006
    Location
    North Yorkshire, England
    Posts
    147
    e.g.
    there are 9 mon period 1s, if 4 are booked then mon period 1 = 44%
    there are 9 mon period 2s, if 6 are booked then mon period 2 = 66%

  10. #10
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    and you want to find the percentage of every period used?

  11. #11
    dac
    dac is offline
    Registered User
    Join Date
    Jan 2006
    Location
    North Yorkshire, England
    Posts
    147
    Quote Originally Posted by bumfluff
    and you want to find the percentage of every period used?
    yes. so ill have a usage percentage for every matching time slot in the 2 month period.

  12. #12
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    right erm I might have an idea.

    Are you taking in bookings?

  13. #13
    dac
    dac is offline
    Registered User
    Join Date
    Jan 2006
    Location
    North Yorkshire, England
    Posts
    147
    yes i need to produce booking examples like joe blogs - week 1 - mon 1 - period 2 - dancing

  14. #14
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    I am afriad that I know nothing about structures as I am a noob but if you can tell me how to read the day and the period then I think I have a way of doing it.

  15. #15
    Registered User
    Join Date
    Nov 2005
    Posts
    545
    There must be a number associate with monday period 1 and tuesday period 2 etc.

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 10-23-2006, 08:22 PM
  2. string array stuck:(
    By mass in forum C Programming
    Replies: 18
    Last Post: 05-22-2006, 05:44 PM
  3. Program stuck in infinite loop-->PLEASE HELP
    By Jedijacob in forum C Programming
    Replies: 5
    Last Post: 03-26-2005, 12:40 PM
  4. Stuck on random generating
    By Vegtro in forum C++ Programming
    Replies: 3
    Last Post: 10-01-2003, 08:37 PM
  5. stuck ky
    By JaWiB in forum Tech Board
    Replies: 2
    Last Post: 06-15-2003, 09:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21