There are two programming tasks, which are explained in two portions below. Please make sure not to modify the name of the functions mentioned below. You can create as many additional methods as you feel appropriate.
Portion 1 (Python): System for managing expenses
You will implement a system for managing expenses. You will download the skeleton of the program, then implement the functions. The design of the program has been set up for you.
In this system, users will be able to add and deduct expenses, update expenses, sort expenses, and export filtered expenses to a file. The program will initially load a collection of expenses from a .txt file and store them in a dictionary.
Steps
• Complete the required functions
• Implement all of the functions defined in expenses.py
• Docstrings have already been provided
• You can create any number of helper functions (with docstrings)
• The main function, the get_expense function, the add_expense and the update_expense function have already been implemented for you
• Add brief comments to all non-trivial lines of code (don’t spend too much time on this)
• Complete the unit testing in the testing file expenses_test.py
• Where noted, write additional test cases for each unit testing function
2. Make sure your program and the unit testing file run without errors!
Submission
You will submit the following 3 files:
• expenses.py: your program
• expenses_test.py: the unit testing file
• expenses.txt: the .txt file to be read by your program. Do not make changes to this file.
Portion 2 (Java): Book cataloging system
You will implement a book cataloging system. You will download the skeleton of the program, then implement the methods and write the unit tests. The design of the program has been set up for you.
In this system, book files can be loaded, parsed, and managed in a book catalog. Books (represented by a Book class) are loaded and stored in a book catalog (represented by a BookCatalog class). A BookFileReader class will take care of initially loading the book files and doing some basic clean-up.
The Book class will take care of extracting the book title and author, counting the total number of words, getting a count of each unique word (case-insensitive), and allow for getting the first n number of lines. The BookCatalog class will allow for adding books and looking up books based on their title or author.
The program will initially load two book files (.txt) with BookFileReader, create two Book objects, and store them in BookCatalog. The required methods are already called in the main method in the BookCatalog class. (Read through the main method to learn the sequence of the program.)
Steps
• Download the provided skeleton program as a .zip file
• Import the program into Eclipse
Tips:
• Create an empty Java project in Eclipse
• Copy files from the downloaded ‘src’ folder into the empty Java project in your workspace
• Refresh the Java project in Eclipse
2. After you download the program and import into Eclipse, you might have to add the Junit 5 library to your build path. You can easily do that by right-clicking on the error and selecting “Fix project setup…”.
• Complete the required methods
• Implement all of the methods defined in BookFileReader.java, Book.java, and BookCatalog.java
• Javadocs have already been provided
• You can create any number of helper methods (with javadocs)
• Add brief comments to all non-trivial lines of code (don’t spend too much time on this)
• The required methods are already called in the main method (follow along to learn the sequence of the program)
• Complete the unit testing in BookTest.java and BookCatalogTest.java
• Make sure each test method includes at least 3 test cases
4. Make sure your program and the unit testing files run without errors!
Submission
You will submit your entire Java project in a .zip file. Make sure it includes your “src” folder with all of your code, and both book files (.txt).