0

i need help on this question. any kind souls can help me? with great thanks.

ive already done some part of it but still cant get it working

#include <iostream>
#include <string>
using namespace std;

class  court
{
protected:
	string name, ic, telephone, fn, day;
	int time;
	
public:
	court(){};
	court(int time, string name, string ic, string telephone, string fn, string day);
	
	void getinfo (void);
	void display (void)
	{
		cout<<"Court : "<<fn<<endl;
		cout<<"Day : "<<day<<endl;
		cout<<"Time : "<<time<<endl;
		cout<<"Name : "<<name<<endl;
		cout<<"NIRC : "<<ic<<endl;
		cout<<"Telephone : "<<telephone<<endl;
	}
};
void court::getinfo()
{
	cout<<"Please choose the court, B1 or B2 : ";
	cin>>fn;
	cout<<"Please enter the day : ";
    cin>>day;
	cout<<"Available time : 10am, 12pm , 2pm , 4pm , 6pm , 8 pm , 10pm "<<endl;
	cout<<"Please choose the time : ";
	cin>>time;
	cout<<"Please enter the Name : ";
	cin>>name;
	cout<<"Please enter yout NIRC : ";
	cin>>ic;
	cout<<"Please enter your Hp number : ";
	cin>>telephone;
};

void main()
{
	court record;
	record.getinfo();
	int i;
	
	cout<<"Your record :"<<endl;
	record.display();
	cin>>i;
};

with much thanks

Attachments
A community centre has decided to computerize the booking of two badminton courts. 
the two courts are named as B1 and B2 . bookings are to be done on a two hour block from 10am to 10pm daily

each booking record should have Facility Name , day and time , the player's NRIC number and the booking status of the court . EAch platyer's record should have name. NRIC number and telephone number.

Desgin the necessary classes and member functions to achieve the following tasks:

a. Allow user to book the court by entering the facility name , day  and time . if it is available , promt the user to enter his name, NRIC  number and telephone number. Display a message "courts is booked" if the facility has already been booked by other player.
b. Allow user to enquire the availability of court for the entire week.
c. Allow user to enquire his/her booking by entering NRIC number.
d. Store the booking record in a text file which the system terminates




TASK

a. Analyse the problem satement
b. identify the objects and classes to be used in the program
c. define the attributes for each class.
d. define the behaviours for each class.
e. define the relationships between classes.
f. apply creativity and thinking skills to design and write a program. the program must have user-friendly interface with clear instructions and rigorous error check.
4
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by William Hemsworth
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.