Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Bike Store is writing a new system to manage inventory. You need to write a class that sets up bikes received. The fields
The Bike Store is writing a new system to manage inventory. You need to write a class that sets up bikes received. The fields to store are brand, model, size, type, and price. There are three different types of employees to enter data about the bikes, the Receiving Clerk, the Tech 1, and the Tech 2. You don't need to worry about the three types of employees, just the roles they play. The Receiving Clerk can only create the bike object and doesn't know any of the properties (fields). The Tech 1 has access to all the properties of the object except price. The Tech 2 has access to all the properties including price. Typical shipment: Brand Model Size Trek T-Domane 52 Type Road Bike Price 7,449.99 Trek T-FX3Disc L Hybrid 929.99 Trek T-Siskiu M Mountain Bike 1,599.00 Trek T-Marlin L Mountain Bike 575.63 Specialized S-Allez 56 Road Bike 1,000.00 Specialized S-Roubaix 54 Road Bike 4,200.00 Specialized S-Rockhopper M Mountain Bike 700.00 Huffy H-SeaStar 18 Kids Bike Huffy H-Rocklt 12 Kids Bike 78.00 58.00 Bike Class: The class should include: 1. A noargs method (pg 349) to instantiate the class (this would be used by the Receiving Clerk) 2. A constructor #1 method (pg 346) to instantiate the class with all initial values except price (this would be used by the Tech 1) 3. A constructor #2 method to instantiate the class with all initial values (this would be used by the Tech 2) 4. A mutator (setter) method (pg 331) for each field, to set the value for the field (these would be used by the Tech 2 to enter all the data for a bike). 5. An accessor (getter) method (pg 332) for each field, to get the value for the field Demo Program (ex: pg 337): Write a demo program that tests the class. 1. Use the noargs method to create an object (tests Receiving Clerk capabilities). It will then need to populate the fields individually (tests the Tech 2 capabilities). 2. Use the first constructor to create an object will all the fields populated except the price (tests the Tech 1 capabilities when they enter data from receiving). It will then need to update the price (Tech 2). 3. Use the second constructor to create an object will all fields populated (tests the Tech2 capabilities when they enter data from receiving). 4. Create a report of the three bike objects to test the get methods Example of 1 of the 3 bikes printed: Brand: Trek Model: T-Siskiu Size: M Type: Mountain Bike Price: $1,599.00 Activat Go to Se Optional Example of the report: Brand Trek Model Size Type T-Siskiu M Specialized S-Roubaix 54 Price Mountain Bike $1,599.00 Huffy H-RockIt 12 Road Bike Kids Bike $4,200.00 $58.00 Hints/Tips: You do not need to enter all the data in the typical shipment. It's there to show you what the system will need to handle. Your need to test your class which will handle uses by the Receiving Clerk, the Tech 1, and the Tech 2. You need to test all the methods you define in your class, which will be accomplished if you following the instructions for the Demo Program. Be sure to test all three constructors. Two of the constructors do not update all the data, so you'll need to set the values that aren't updated individually. The class program is very easy to write, just make sure you do the right thing in the right places. I copied code and didn't make all the necessary changes, slowing me down in testing. You can hardcode the values for the bikes rather than getting the info from the user. It makes testing much easier. It took me a little over 45 minutes to complete, which included the class and demo programs. Rubric: There is no bike class -100% Missing demo program -50% Noargs method missing -10% Constructor #1 missing -10% Constructor #2 missing -10% Mutator methods missing -5% for each 5 fields Accessor methods missing -5% for each of 5 fields Report of the 3 bikes tested is missing -20% Doesn't test all the class methods (including constructors) -5% per missed method Problems in the bike report -varies by problem
Step by Step Solution
★★★★★
3.35 Rating (158 Votes )
There are 3 Steps involved in it
Step: 1
Class Motor class Motor private String brand private String model private String si...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