Homework 6 - Texting

Introduction

In this assignment you will practice

Problem Description

In this homework, you will be creating a database that can store text messages and filter those messages based on certain constraints!

Solution Description

Classes:

Important: getMessagesBetween(LocalDateTime start, LocalDateTime end), sortMessagesByContact(), getMessageWithKeyword(String keyword), and getMessagesWithPriority() must use filter with a lambda expression, an anonymous inner class, an inner class, and a method reference respectively.

Make the visibility of all the methods and fields as you see best fits good programming style.

Tips and Considerations

If anything seems confusing, read through the entire description and instructions again. As always, feel free to contact your TAs, post on Piazza, or come in for TA office hours. In addition, here are some tips specific to this homework:

Import java.util.function.Predicate, java.util.Optional, java.time.LocalDateTime, java.util.List, java.util.Map, and any class that implements List or Map. Do not import anything that oversimplifies the assignment.

If there are any classes that you are unfamiliar with (e.g. Predicate, LocalDateTime, Optional), look them up in the Java API.

Test things out in JShell!

Grading

Submit code that compiles!!!

Non compiling code will receive an automatic zero.

Checkstyle

For each of your homework assignments we will run checkstyle and deduct one point for every checkstyle error.

For this homework the checkstyle cap is 100, meaning you can lose up to 100 points on this assignment due to style errors.

Collaboration

When completing homeworks for CS 1331 you may talk with other students about:

Examples of approved/disapproved collaboration:

OKAY: “Hey, I’m really confused on how we are supposed to implement this part of the homework. What strategies/resources did you use to solve it?”

BY NO MEANS OKAY: “Hey… the homework is due in like 20 minutes… Can I see your code? I promise won’t copy it directly!”

In addition to the above rules, note that it is not allowed to upload your code to any sort of public repository. This could be considered an Honor Code violation, even if it is after the homework is due.

Submission

Submit each of your Java source files necessary for Database to compile on Canvas as separate attachments. When you’re ready, double-check that you have submitted and not just saved a draft. Download each file and compile them to assure that nothing went wrong with the submission process.

Files needed:

Verify the Success of Your Submission to Canvas

Practice safe submission! Verify that your HW files were truly submitted correctly, the upload was successful, and that your program runs with no syntax or runtime errors. It is solely your responsibility to turn in your homework and practice this safe submission safeguard.