CS 1301 Homework 3 - Building A Dictionary1
CS 1301 Homework 3 - Building A Dictionary1
CS 1301 Homework 3 - Building A Dictionary1
Homework #03
Due 10/19/2022 11.59 pm
Building a Dictionary
Note about collaboration: For this homework, you are required to Work by yourself.
No Partners allowed. All program source code and designs will be checked for
similarity. If similarity is found , it will be investigated for plagiarism.
Assignment total points = Design (20 points) +Runs given test cases successfully (30
points) + Implementation correctly written (55 points) = 105 points using formatting
in print statements
Problem Description:
For this assignment, we are going to build a dictionary where a user can 1) lookup
the definition of a word, 2) add a definition to a word, 3) remove the definition
of a word
Variable: a quantity or function that may assume any given value or set of
values.
...
Variable: a quantity or function that may assume any given value or set of
values.
Function: a set of ordered pairs in which none of the first elements of the
pairs appears twice.
Test Plan (30 points) We have shared with you a file that contains testing
component(we will be using the unittest library for this hw). You will write your
solution in this file, and check your logic by passing the test cases.This file contains
test cases that will be run with your code(DO NOT MODIFY THE CODE IN THE
TestDictFunctions class). To get all credits, make sure your code pass all test cases.
There will be no screenshot/Working by hand test case for this homework. There is 6
test cases each worth 5 points. If you write your code in a way such that it works
ONLY for test cases, you may not receive any points for this section.
NOTE: This is the only file you will need to submit for this assignment.
Write the design for the program in pseudocode as comments in your main file
● Give the three P's (purpose, pre- and post-conditions) and author info as
usual. The steps do NOT have to be numbered.
· # supply program prolog (3 P's)
· # main function
● Use the test cases as a starter on how to approach your implementation and
improve your design
● Make sure that you create the appropriate functions with matching names as the
functions in the test files. Think about return values of functions as well. What
should be the appropriate return value of the add_to_dict() function so that I
can pass the test cases.
● This program uses input; you will have to prompt the user for the inputs. The
inputs can be assumed to be always be of the appropriate type
● Points will be exclusively given for good formatting and good user interaction
for your program.(5 pts)
● You will have to print a dictionary for some part of this assignment, feel free to
just print the dictionary without any formatting, if you know and can use loop
for this feature, please do(5 bonus pts) This might help you link
● Think about those different edges cases
1. What should you do if a user enter “5” when they should enter a
number betwen 1 and 3 for their selection
2. What should your lookup function return when a user lookups a
word that is not in your dictionary(Hint: look at test cases)
3. What should you do when a user adds a word that already exist in
your dictionary(Hint: look at test cases)
4. what should you do when user tries to remove a word that does
not exist in your dictionary(Think about what you should print in
the console here)