Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

LAB 7:: Q1. Relationship of book with its pages can be modeled as containership.

ID: 3541601 • Letter: L

Question

LAB 7::


Q1. Relationship of book with its pages can be modeled as containership. Comment.


Q2. Define a class Priority_Queue that represents a bounded priority queue of nodes. To represent a node you must define a class Node having member variables Data (description of node,type string) and a Priority_No. In Priority_Queue class, provide following two methods. Enqueue: that inserts a node in the queue at appropriate position, based on its Priority_No, if queue is not full. Dequeue: that displays and removes a node from front of the queue, if queue is not empty.


Q3. Create a class Employee, the member data should include Employee number (type integer), Name of employee [to be allocated dynamically] and Salary (comprising of three float variables; Gross pay, Deductions and Net pay). Also include date of joining of employee. The date should comprise of three integers representing day, month and year. You need to define separate classes for Date and Salary. Include necessary constructors, destructors and member functions to enter and display the data in each class.


Q4. Define a class Database that uses a dynamic array of Employee

Explanation / Answer

Create a class Employee, the member data should include Employee number (type integer), Name of employee [to be allocated dynamically] and Salary (comprising of three float variables; Gross pay, Deductions and Net pay). Also include date of joining of employee. The date should comprise of three integers representing day, month and year. You need to define separate classes for Date and Salary. Include necessary constructors, destructors and member functions to enter and display the data in each class.