CS200: Intro To Programming Fall 2021-22: Let's Begin!
CS200: Intro To Programming Fall 2021-22: Let's Begin!
Fall 2021-22
Section 2 Thursday, 27 Oct 2021
Mid-Term Manual
Lab Guidelines
1. You are allowed to perform/submit the mid-term during the lab timings only
2. Do not leave the lab without submitting your work on LMS
3. Copying/sharing code is prohibited. Using any unfair means will lead to immediate disqualification
4. Put your work in a folder YourRollNo_Mid_TAname and submit it on LMS (Assignments → Mid)
5. In case of any unforeseen circumstances, please inform your assigned TA immediately
40 20 60
Let’s Begin!
Task 1: [40 marks]
Estimated time: 80 minutes
intervals[i] = [start_i, end_i] represent the start and the end of the ith interval and
intervals is sorted in ascending order by start_i. Also provide an interval newInterval =
[start, end] to insertInterval() that represents the start and end of another interval.
Insert newInterval into intervals such that intervals is still sorted in ascending order by
start_i and intervals still does not have any overlapping intervals (merge overlapping
intervals if necessary).
You may provide any other arguments to insertInterval() if required. Please don’t start
coding right away, first spend some time to form your logic, then proceed further to
implement it in code.
Marks Distribution:
Creating the memory allocation, element insertion, print, and element deletion functions
correctly (must be fully functional) [10 Marks]
_____________________________________________________________________
Task 2: [20 marks]
Estimated time: 40 minutes
In this task, you are going to be implementing a sorted array of angle measurements
modelled as objects of the class named distanceMetrics.
Create a class named distanceMetrics which has the following member variables and
functions:
● Member Variables (all private):
_____________________________________________________________________