Question: In C++ 2. Write a C++ program (or Java program) called hw4_2.cpp (or hw4_2.java) that reads a set of events and displays the maximum number

In C++

In C++ 2. Write a C++ program (or Java program) called hw4_2.cpp

(or hw4_2.java) that reads a set of events and displays the maximum

2. Write a C++ program (or Java program) called hw4_2.cpp (or hw4_2.java) that reads a set of events and displays the maximum number of events that take place concurrently. Input format: This is a sample input from a user. 5 7 12 10 14 8 11 12 15 16 20 The first number (= 5 in the example) indicates that there will be five events in a convention center. All numbers from the second line to the last line are event hours. For example, the first event starts at 7:00(AM) and ends at noon (= 12:00(PM)). The second event starts at 10:00(AM) and ends at 2:00(PM). The last event starts at 4:00(PM) and ends at 8:00(PM). Sample Run 0: Assume that the user typed the following lines 5 7 12 10 14 8 11 12 15 16 20 This is the correct output of your program. Max events: 3 2. Write a CH program (or Java program) called hw4_2.cpp (or hw4_2.java) that reads a set of events and displays the maximum number of events that take place concurrently. Input format: This is a sample input from a user. 5 7 12 10 14 8 11 12 15 16 20 The first number ( 5 in the example) indicates that there will be five events in a convention center. All numbers from the second line to the last line are event hours. For example, the first event starts at 7:00(AM) and ends at noon (= 12:00(PM)). The second event starts at 10:00(AM) and ends at 2:00(PM). The last event starts at 4:00(PM) and ends at 8:00(PM). Sample Run 0: Assume that the user typed the following lines 5 7 12 10 14 8 11 12 15 16 20 This is the correct output of your program. Max events: 3 Note that there will be three events from 10:00(AM) to 11:00(AM). Also, there will be three events at 12:00(PM). So, the maximum number of events that take place concurrently should be 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!