Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program to display workers schedule for a company. To accomplish this (1) Write a struct Time with attributes (at least) : hours,

Write a C++ program to display workers schedule for a company. To accomplish this (1) Write a struct Time with attributes (at least) : hours, minutes and seconds. Add other functions or attributes you need to get the job done (2) Write a class Schedule with attributes : Day of week, start_time, end_time and activity. Schedule should have at least (a) Display to display the schedule (b) Length to return the duration of the schedule (ie end_time - start_time), (c) ReadSchedule to read schedule from user (2b) Your program must check that only appropriate numbers are entered for Time in ReadSchedule (default value for hour/minute and second is 0) (2c) Your program should indicate error when end_time < start_time. (3) You should store the schedules in a vector (4) Create the struct Time and class Schedule in a file named schedule.h which you must include in main.cpp (5) Your program should produce EXACTLY the same output as the enclosed program (run sample.exe to see the output). Feel free to use the skeletal program I have provided in the enclosed zip file.

Below are the extracted files for main.cpp and schedule.h that i need to work them.

main.cpp

void DisplaySchedule(vector schs) { cout<<"-----------------------------CURRENT SCHEDULE---------------------------------------------------- "; for(int i=0;i

int main(int argc, char** argv) { //FILL IN THE CODES return 0; }

schedule.h

#pragma once #include #include #include

using namespace std;

struct Time { int Hour; int Minute; int Second; Time():Time(0,0,0){ } //default constructor - "calls" constructor with parameters Time(int hr, int min, int sec) //constructor with parameters { Hour = hr; Minute = min; Second = sec; }; //read time from user void ReadTime() { } //show time void Show() { cout<

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions