Answered step by step
Verified Expert Solution
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 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 bikes that meet the criteria, and the number in the parameter list is 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: Choose one for me List inventory by wheelSize List inventory by type List inventory by gender List inventory by assembled List entire inventory QuitdetermineSearch this method displays the menu options if the user chooses option from the main menu Choose one by wheelSize Choose one by type Choose one by gender Choose one by assembled 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 of the main menu, then you would pass a 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
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