The majority of forums are now only available as archives, which means posting/editing is disabled.
The Anything and Everything forum is still open.
The Anything and Everything forum is still open.
HELP
|
|||
|
Rank: Unregistered
|
Hi wondering if u could help I have a program,
I need to add some code to the user can request the first free hour, heres my code so far, can any1 help me. #include <iostream.h> class bookinsys{ int day[9]; public: bookinsys(); void appt(int num); void display(); void GetDate(int &dd, int &mm, int &yy); void FormatDate(int dd, int mm, int yy); }; bookinsys::bookinsys() { int i; for (i= 0; i<9; i++) day[i] = 0; } void bookinsys::appt(int num) { int k; k = num - 9; if (day[k] == 0) { cout<< "This is your allocated time "<<k + 9<<"\n"; day[k] = 1;} else cout<< " Place Filled\n"; } void bookinsys::display() { int i; for (i= 0; i<9; i++) if (day[i] == 0) cout<< (i+9) << " Avalible\n"; else cout<< (i+9) <<" Booked\n"; } main() { void GetDate(int &dd, int &mm, int &yy); void FormatDate(int dd, int mm, int yy); bookinsys t; int n; cout << "Please enter Today's Date (dd mm yy) : "; int day, month, year; GetDate(day, month, year); cout<<"The Date you entered was : "; FormatDate(day, month, year); cout<<"\n"; while ( n != 18){ cout<< " Choose an hour between 9 and 17\n"; cin>> n; t.appt(n); t.display();} int s; cout<<"enter s to stop"; cin>>s; return 0; } void GetDate(int &dd, int &mm, int &yy){ cin >> dd; cin >> mm; cin >> yy; } void FormatDate(int dd, int mm, int yy){ cout << dd << ":" << mm << ":" << yy; } |
||
|
|||
|
|||
|
Rank: ? (39)
Member #: 14820 |
Code:
Notice:
If you notice this notice, you should also notice that this notice is not a notice!
|
||
|
Please login or register to post a reply.
