Homework #1 CS 351.001
Homework #1 CS 351.001 Spring 2024 Data Structure II 50 Points Due: 02/07/2024, 11:59 PM Read the instructions thoroughly. Points will be deducted if the instructions are not followed properly. Upload the .java files on the Western Online Homework 1 assignment page. Do not upload .class files. 1. Write a Java program to implement a dictionary using an array that stores some words and their corresponding meanings. The size of the dictionary (i.e., maximum number of words) will be decided by the user. Write a menu-driven program to insert words and their meanings in the dictionary in ascending order, search for a specific word, delete a word, and print the entire dictionary per the user’s choice. All words must be unique in the dictionary. Take all inputs from the user. DO NOT use any built-in Java classes, such as ‘Array’, ‘ArrayList’, ‘Dictionary’, and any sorting methods. Consider all possible cases of user’s choices. You can use the Java Scanner class to take elements from the user. The sample input/ output is given below: (25 points) Sample input/ output: (User’s input is shown in bold) Please enter the size of your dictionary: 3 Press 1 to insert a word and its meaning Press 2 to search for a word Press 3 to print the entire dictionary Press 4 to delete a word Press 5 to terminate the program Enter your choice: 2 The dictionary is empty. Searching is not possible. Enter your choice: 3 The dictionary is empty. The display is not possible. Enter your choice: 4 The dictionary is empty. Deletion is not possible. Enter your choice: 1 Enter a word: Data Enter its meaning: Facts and statistics collected for reference or analysis. Enter your choice: 1 Enter a word: Computer Enter its meaning: An electronic device for storing and processing data, typically in binary form. Enter your choice: 1 Enter a word: Data Sorry, the word is already present in the dictionary. Enter your choice: 2 Enter the word to be searched: Java The word is not found. Enter your choice: 2 Enter the word to be searched: Data Facts and statistics collected for reference or analysis. Enter your choice: 1 Enter a word: Java Enter its meaning: A computer programming language designed to produce programs that will run on any computer system. Enter your choice: 3 Dictionary words: Computer: An electronic device for storing and processing data, typically in binary form. Data: Facts and statistics collected for reference or analysis. Java: A computer programming language designed to produce programs that will run on any computer system. Enter your choice: 1 Sorry, no more words can be inserted. Enter your choice: 4 Enter the word to be deleted: Class The word is not found. Enter your choice: 4 Enter the word to be deleted: Data The word is deleted from the dictionary. Enter your choice: 3 Dictionary words: Computer: An electronic device for storing and processing data, typically in binary form. Java: A computer programming language designed to produce programs that will run on any computer system. Enter your choice: 5 Thank you! 2. Write a menu-driven program in Java to implement the above problem using a Singly Linked List. In this problem, you can add as many words and their meanings as possible into the dictionary. You may either use the built-in Java LinkedList class to implement the problem or implement your own Singly Linked List class. Make sure that words must be inserted in the list in ascending order. Do not sort the list. Follow the Sample input/ output of Question 1 for this problem also. (25 points)
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.