Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions Past Papers/Final Exam/2018/2018-01-(f).cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include<iostream>
using namespace std;

// Order details class (Part)

class OrderDetails{

private :
int qty;
string taxStatus;

public :
void calcSubTotal();
float clacTax();
};

// Oder class (Whole)

class Order{
private :
int date;
string status;
double price;
OrderDetails *orderdetails; // define "Part" object here

public :
void addOrderDetails(OrderDetails *od){
orderdetails = od;
}

void calcSubTotal();
float calcTax();
double calcTotal();
};

int main() {



}
90 changes: 90 additions & 0 deletions Past Papers/Final Exam/2018/2018-04.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#include <iostream>
using namespace std;
#define SIZE 20

class Ward;
class Team;
class Doctor;
class Patient;

//Doctor class (parent)
class Doctor{

private:
Patient *patient[SIZE];

protected:
string Speciality[10];
string location[10];


};

//ConsultantDoctor class (child)
class ConsultantDoctor:Doctor{

private:
double fee;
Patient *patient[SIZE];
Team *team;
};

//JuniorDoctor class (child)
class JuniorDoctor:Doctor{

private:
int hours;

};

//Patient class (association-bi)
class Patient{

private:
string id;
string gender;
int age;
int Accepted;
string sickness[10];
string prescription[10];
string allergies[10];
string specialReq[10];
Doctor *doctor[SIZE];
ConsultantDoctor *cd;
Team *team;
Ward *w;
};

//Team class (association-bi/composition-whole)
class Team{

public:
string name;
ConsultantDoctor *cd;
Doctor *d;
Patient *p[SIZE];

};

//Ward class (association-bi/composition-part)
class Ward{

private:
string name;
string gender;
int capacity;
Patient *p[SIZE];

};

//Hospital class (composition-whole)
class Hospital{

private:
string name;
string address;
string phone;
Ward *w[SIZE];
Team *t[SIZE];

};