Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CMSC 256 -Sorting and Searching Lalb In this lab, you will perform searching and sorting operations on a set of data of the names of
CMSC 256 -Sorting and Searching Lalb In this lab, you will perform searching and sorting operations on a set of data of the names of registered dogs from Anchorage Animal Care and Control as of 7/13/2017 in the Municipality of Anchorage, Alaska This data can be found in the file, Dog_Names.csv (source: https://data.muni.org/resource/r849- w2cw.ison?$limit-8000) You may hard-code the file name for this lab Your program should be called DogNamesLab.java You will use command line arguments to direct how the program will function. The argument is a single number that corresponds to the part of the lab described below. For example, if the program is run with an argument of 1, Part 1 is executed. These steps apply to all three parts 1. 2. 3. PART 1 Implement a Dog class that has the fields, dogName and count Read names from data file, create Dog objects, and add them to an array or ArrayList Prompt the user and respond This part of the program prompts the user to enter a dog name and responds with the number of dogs registered with the same name. Here's a sample run of the program Enter a dog's name? User types: Zoey Zoey is registered 33 times. PART 2 If the command line argument is 2, the program displays a list of all the dog names in alphabetical order. PART 3 If the command line argument is 3, the program presents two dog names from the data set and asks the player to guess which dog name is more popular. The program responds to the guess with either "Yes, that's right." or No and the correct answer Then, the player is asked if they'd like to continue. If they respond "Y", two new dog names are presented to them. When they decide to stop playing, a report of the number of correct guesses is given. Here's a sample run of the program Which name is more popular for Anchorage dogs? (Type 1 or 2) 1. Bingley User types: 1. Nope, the more popular dog name is Zoey. Do you want to play again? (Y/N]) 2. Zoey You guessed correctly O out of 1 times
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