Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. In the following program an employee of a company is represented by an object of type employee consisting of a name, employee id, employee

image text in transcribedimage text in transcribed

2. In the following program an employee of a company is represented by an object of type employee consisting of a name, employee id, employee salary and the workday starting time. The starting time is a class time 24 object. Implement the class employee. Declaration of Employee and Time Classes /* File : employeetime.h Hlustrates composition of classes */ #ifndef EMPLOYEETIME.H #define EMPLOYEETIME.H #include #include using namespace std; class time 24 { private : int hour; int minute ; // hour between 0 and 23 // minute between 0 and 59 public : time24 inth, int m); void write (ostream & out) const ; // constructor // prints hour: minute to out class employee { private: string name; // last name int id ; employee id number float salary; // employee salary time 24 start; // workday start time public : employee(string n, int i, float s, inth, int m); void write (ostream & out) const; #endif /* EMPLOYEETIME.H */ Implementation of Employee and Time Classes /* File: employeetime.cpp Implementation of classes employee and time */ #include "employeetime.h" ////////////////// Implementation of time 24 /IIIIIIIIIIIIIIIIIIIIIIIIII time24 :: time24 (inth, int m) hour = h; minute = m; void time 24 :: write (ostream &out) const out

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions