Pak-Wheel requested for a software and asked for the following functionalities.
o Client name, contact, email and transection (only one) are important to keep.
o Client can buy or sell car through pinwheels. The transection details which are
important to keep are date (day), transection type (Buy or Sell) and amount.
Implement the above demand in such a way what if the client is deleted, none of its transection
record will remain. (Use Composition)
4. Later they requested another functionality to be incorporated within the program:
o The car should have its owner detail (client) but if the car is gone or sold, the client
should remain. (Use Aggregation)
Here is program:
class Client
{
public:
Client(string clientname,string contact, string email, string transection ,string date)
{
}
void Transection(bool summ)
{
cin >> summ;
if (summ == true)
{
cout << "Buy" << endl;
}
else
{
cout << "Sell" << endl;
}
}
private:
string clientname, contact, email, transection;
string date;
};
Comments
Leave a comment