Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction In Java you will generate algorithms that conform to a specific complexity. This is useful when developing an application and considering different ways of

Introduction

In Java you will generate algorithms that conform to a specific complexity. This is useful when developing an application and considering different ways of approaching a solution. For this assignment you coordinate bands for different venues, specializing in 90s bands. You keep track of bands and their average set time, and use this to assist in booking the bands. (You would want to keep track of other attributes of the bands such as contact info, set lists, etc.). You will need to load the file containing your data, sort the file by band name and set times. You will prompt the user if they want to search by band name or set time. If searching by band name, you will display the band name and the set time. If searching by set time, you will display the band with the closest set time (could be less than or could be greater than the set time).

Description

The program will need to perform the following tasks:

Display your name and email address as the first output

Create a separate class that holds the band information with the following two properties and have appropriate getters and setters

o String bandName

o Float setTime

Load the file that contains the band name and set time

o Pipe (|) separated (Black Lab|56.12)

o Set time is a float, a lot easier to sort and search with 56.12 than 56:12

Prompt the user to search by Band name or Set Time

At least one of the search algorithms must be recursive

When searching by Band Name, you must write your own sort algorithm, and it must have a complexity of O(log n) or better

When searching by Set Time, you must write your own search algorithm, and it must have a complexity of O(n) or better

When sorting your data, you cannot use Collections.Sort, you will need to write your own sorting algorithms and it must have a complexity of O(n^2) or better

When displaying the found band, you must override the toString method example line

o System.out.println("Band with closest set time is: " + foundBand);

Code Compiles

Code Structure

Comments

Load file contents info appropriate Data Structure

Sort by Band Name (not using Collections.sort)

Sort by Set Time (not using Collections.sort)

Search by Band Name in O(log n) or better

Search by Set Time in O(n) or better

Override toString method in Band Info class

Sample Run (User input is bold)

Submitted by: Jane Doe - jdoe@email.com

Search by Band Name (1) or Set List (2):

1

Enter Band Name you are looking for:

nirvana

Bandname is: nirvana

Band [nirvana] was not found

Search by Band Name (1) or Set List (2):

1

Enter Band Name you are looking for:

the nixons

Bandname is: the nixons

Band found is: The Nixons has a set time of 55.33 minutes

Search by Band Name (1) or Set List (2): 2

Enter the Set Time you are looking for:

12

Band with closest set time is: Sponge has a set time of 39.59 minutes

Search by Band Name (1) or Set List (2): 2

Enter the Set Time you are looking for:

44

Band with closest set time is: FAT has a set time of 44.56 minutes

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is a change agent? Who plays this role?

Answered: 1 week ago