Question
Liking Things In this assignment you will add the ability to like things to your Facebook application. Specifically, there should now be two new menu
Liking Things
In this assignment you will add the ability to like things to your Facebook application. Specifically, there should now be two new menu options: one for a user to indicate that they like something (any String), and another to list all of the liked things in alphabetical order. When a user chooses the like menu option, they should be prompted for their username and password. If these are valid, the program should prompt for the String indicating what the user likes. Update the data structure and then provide a response to the user indicating that their like has been noted (e.g. CommanderCool likes puppies.) If a user has already liked something once, liking it again should have no effect. Now that we have learned about a variety of data structures available in Java, you need to become comfortable with choosing the appropriate data structure for a particular task. With this in mind, you are required to have a comment somewhere in your Facebook class that indicates which data structure you have used to store the likes information and explains why you have chosen it. Begin this comment with the word EXPLANATION (in all caps) so that I can search for it when grading your work.
Menu options should be:
System.out.println("Menu:"); | |
System.out.println("1. List users alphabetically"); | |
System.out.println("2. List users by number of friends"); | |
System.out.println("3. Add a user"); | |
System.out.println("4. Delete a user"); | |
System.out.println("5. Get password hint"); | |
System.out.println("6. Add friends"); | |
System.out.println("7. Remove friends"); | |
System.out.println("8. List friends"); | |
System.out.println("9. Recommended friends"); | |
System.out.println("10. Like"); | |
System.out.println("11. List likes"); | |
System.out.println("12. Quit"); | |
System.out.print("Please choose one of the options: "); |
You will be graded according to the following rubric (each item is worth one point): The driver menu contains the two new options The program prompts for username, password, and String to like The number of likes is updated when username and password are valid Liking something more than once has no effect The choice of data structure to store the likes information is logical and welldefended in a comment beginning with EXPLANATION The program can list the likes (String and number) Likes are listed in alphabetical order The program compiles The program runs The program is clearly written and uses standard coding conventions Note: If your program does not compile, you will receive a score of 0 on the entire assignment Note: If you program compiles but does not run, you will receive a score of 0 on the entire assignment Note: If your Eclipse project is not exported and uploaded to the eLearn drop box correctly, you will receive a score of 0 on the entire assignment Note: If you do not submit code that solves the problem for this particular assignment, you will not receive any points for the programs compiling, the programs running, or following standard coding conventions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started