Exam 1

Release: 10am Friday January 21, 2021

Due: 10pm Saturday January 22, 2021

Note that this is released after class Friday, and is due the next day in the evening. We will not accept late submissions.

This page details a take-home exam that you will complete over the next day. You can’t communicate with anyone about the content of the assignment until the exam ends. You can message us privately on Piazza, but the course staff will not give programming advice or answer most questions about the problems. If you have technical trouble creating a screencast (detailed below) feel free to reach out for assistance.

Do not use any online service other than Piazza to ask questions about the assignment. Do not search for, solicit, or use solutions to the problems that you find elsewhere for the exam. These are all violations of academic integrity that students have committed on exams like this in the past.

You can make use of any course notes, online resources about Java and its libraries, Java tools, and so on to complete the exam, including re-using code from class notes.

You can review the grading policy for exams in the syllabus. You will complete the programming task below and submit your work to the Exam 1 Gradescope assignment.

Submission checklist (see long descriptions below for full details):

Your submission will be graded after the deadline. You should test thoroughly yourself to make sure your program works as expected.

Clarifications

Can I use a Java feature/library/method that we haven’t covered in class?

No. Strive to create a solution that only uses concepts covered so far in the course.

I can’t get my code to run on my computer.

Ideally, you should have already solved this issue as we are running programs the same way as PA1 and PA2. But you may try reviewing the previous public Piazza posts, which have lots of advice about fixing these situations. Also make sure that your code doesn’t have a bug before you blame your computer or ./run!

I get a score of 0.0/0.0 on autograder.

This is expected, we will reveal scores after the exam has concluded.

It says the autograder didn’t run successfully.

Make sure that your code has no errors and you match the specification for ALL classes and method headers exactly.

Can I submit multiple times until the deadline?

Yes, we will grade the last submission you make before the deadline.

Tasks

You can find the starter code in this repository https://github.com/ucsd-cse11-w22/cse11-exam1-starter.

For all tasks, do not make any assumptions besides the ones explicitly mentioned. You may assume all objects will be non-null.

Task 1

In the ExampleMethods class, you will use the design recipe to write two methods:

You are welcome to add any number of additional methods to help with your implementation.

You can add tests in the provided ExampleMethods class.

Task 2

The file ExampleCourses.java you will be writing 2 classes and 2 methods.

You will add 2 classes:

Additionally, you will add 2 methods to Course.

You are welcome to add any number of additional methods to help with your implementation.

You may add tests in the provided ExampleCourses class.

Implementation Suggestions for Task 2

  1. Helper methods

    You may find it helpful to add several helper methods to help with your implementation for Task 2. Here are three that you may find helpful to use.

     Course: 
     // return true if there is overlap between this and other course
     boolean overlap(Course c);
    
     Time:
     // return true if this time is before other time
     boolean before(Time t);
    
     // return time between this time and other time
     int between(Time t);
    
  2. Types of overlap

    Be aware of the 4 types of overlap

    1. Course 1 ends after Course 2 starts.

      Ex: 9am - 10am and 9:30am - 10:30am

    2. Course 1 starts before Course 2 starts and ends after Course 2 ends

      Ex: 9am - 10am and 9:15am - 9:45am

    3. Course 1 starts after Course 2 starts and ends before Course 2 ends

      Ex: 9:15am - 9:45am and 9am - 10am

    4. Course 1 starts before Course 2 ends

      Ex: 9:30am - 10:30am and 9am - 10am

    If Courses share a time boundary, they are not considered overlapping.

    Ex: 9am - 10am and 10am - 11am are two non-overlapping courses

  3. Courses starting and ending on different days

    Be aware that a course may start and end on different days. This may apply to 0, 1, or 2 courses when calling both shiftToRemoveOverlap and timeBetween.

    Ex: 23:00 - 2:00 is a valid course time.

Task 3 – Video

You will record a short video of no more than 5 minutes. Include:

Your task:

An example of what your video should look like when doing this kind of explanation is here:

https://drive.google.com/file/d/117NfZaHXbHtMJZJmLRVeRy-1b9cY3jei/view?usp=sharing

PA2 has a tutorial for creating a screencast like this https://ucsd-cse11-w22.github.io/assignments/pa2.html.

Here are some notes on how to improve your videos: