Your program should ask for the input from the user. The input ends with 999 to indicate that there are no more classes to be scheduled.   Please enter class details.   3203 100 1500 1103 100 1500 2201 300 800 2203 100 1500 3401 200 800 1201 100 1500 999    The output should be the following:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Your program should ask for the input from the user. The input ends with 999 to indicate that there are no more classes to be scheduled.

 

Please enter class details.

 

3203 100 1500

1103 100 1500

2201 300 800

2203 100 1500

3401 200 800

1201 100 1500

999 

 

The output should be the following:

 

3401 starts at 800 ends at 1000

2201 starts at 1000 ends at 1300

3203 starts at 1500 ends at 1600

2203 starts at 1600 ends at 1700

1201 starts at 1700 ends at 1800

1103 starts at 1800 ends at 1900

 

 

To help you get started, you are given with a code snippet to write your code.

 

#include <iostream>

using namespace std;

 

struct Course

{

   int ccode;         // course code

   int duration;        // class duration in military hours, so 2 hours is 200 an so on

   int lecture_arrive_time;   //prefered start time 800 for 8am and 1200 for 12pm

};

 

void print_sched(Course c[],int);

void class_sort(Course c[],int);

 

int main()

{

  int input=0,i=0;

  Course classes[100];

  cout << "Please enter class details:" << endl;

  cin >> input;

  while (input != 999){

    classes[i].ccode = input;

    cin >> classes[i].duration;

    cin >> classes[i].lecture_arrive_time;

    i++;

    cin >> input;

  }

  class_sort(classes, i);

  print_sched(classes, i);

}

 

** you will need to implement the functions **

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education