Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A bicycle shop maintains information about bicycles it has in stock. A bicycle is represented by the Bicycle class. Information about the inventory of bicycles

A bicycle shop maintains information about bicycles it has in stock. A bicycle is represented by the Bicycle class. Information about the inventory of bicycles at the shop is stored in a BicycleInventory class, which contains a list of the bicycles in stock at the shop.Your program must display your name before it displays anything else.The details for each class are below:Bicycle class:Instance variables:Type, which describes the type of bike: mountain, speed, hybrid, road, dirtwheelSize, which represents the size of the wheelassembled, which represents whether the bike comes assembledgender, which is a single character- f or mMethods:default constructorcustom constructor that accepts all four instance variablesgetters for all four instance variables- this should be created automatically by EclipsetoString- should be automatically created by Eclipse, and then modified so that gender prints out the full gender, not just the character.BicycleInventory classInstance variables:a Bicycle array that stores each Bicycle in the inventorya variable that represents the size of the Bicycle arrayMethods:default constructor that instantiates the array to a size of 100 and sets the variable size to zeroreadInventory- this method reads the data from the bicycle.txt file and stores it in the array.getChoices- this method will be overloaded multiple times to accept each of the four parameters, as well as a number. It will retrieve a specific number of bikes indicated by the number input. In other words, it will search through the list to find the bikes that meet the criteria indicated in the parameter but will only find as many as the number indicated in the parameter list. So if there are 5 bikes that meet the criteria, and the number in the parameter list is 3, it will return the first three bikes it finds. In addition to the four instance variables, you will create an additional overloaded method with all four instance variable values and the number, for a total of five getChoices methods.chooseOne- this method will also be overloaded multiple times with the same parameters as getChoices. It will call getChoices with the same parameters. This method returns a randomly selected bicycle from the list of bicycles provided from getChoices. There should be five chooseOne methods.Getters for the two instance variables. The method should return a copy of the array, not the original array.BicycleDriver class:Methods:main- this method will drive the flow of the program in a loop to process the users choice after displaying the menu of options.menuOptions- this method will display the users options:1- Choose one for me2- List inventory by wheelSize3- List inventory by type4- List inventory by gender5- List inventory by assembled6- List entire inventory7- QuitdetermineSearch- this method displays the menu options if the user chooses option 1 from the main menu.1- Choose one by wheelSize2- Choose one by type3- Choose one by gender4- Choose one by assembled5- Choose one by alldetermineSearchCriteria- this method will process the users choice after displaying the menu in determineSearchoutputLIst- this method accepts a parameter that determines the search criteria used to filter output. For example, if the user chooses option 2 of the main menu, then you would pass a 1 to the outputList, which would then output all the data for a given size of wheel. This method should determine what the value is for the specific search field and then traverse the list and find all the bikes that satisfy that criteria.The list of methods provided are simply a suggested approach. You may add or change any methods that you wish, in order to meet the criteria. However, the program must have the same menu options as indicated and every menu choice must work correctly. The output may be altered, as long as the same information is displayed. You must use arrays only to store your bicycle information. The bicycle.txt file is included. You must not alter this file in any way. You must overload methods and not give them separate names for each overloaded method.bicycle.txt

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

Explain the functions of financial management.

Answered: 1 week ago

Question

HOW MANY TOTAL WORLD WAR?

Answered: 1 week ago

Question

Discuss the scope of financial management.

Answered: 1 week ago

Question

Discuss the goals of financial management.

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago