Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

All in Java 1 / 4 100% + TO BORBON Part 1 Created a class named Basketball Player with the following String instance variables me

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
All in Java
1 / 4 100% + TO BORBON Part 1 Created a class named Basketball Player with the following String instance variables me position the following double isntance variables height weight and the following integer variables agility speed ball Handling All instance variables should be declared as private with get and set methods included for each Part 2 In the BasketballPlayer class, create three constructors Constructor 1: 0-argument constructor with all instance variables initialized to "Unknown" or 0 Constructor 2: 3-argument constructor which receives 3 Strings as arguments and assigns the 3 String instance variables to them and 0 to all other instance variables Constructor 3: 8-argument constructor that receives an argument for each instance variable and assigns it approriately 100% + Part 3 In the Basketball Player class, create a method named get Value that examines the values the instance variables and returns an integer value determined according to Figure 1. Use a branching technique (e.gif statements, switch statements) when implementing the method Position Other conditions Value Center height >=82, weight between 220 and 250, ball handling > 5 10 Center height >80, weight between 210 and 260, ball handling >5 8 Center beight > 80, ball handling 4 6 Center height >= 78, agility > 7 5 Center height >=78 4 Center height 76, agility 2 Center 0 Forward height >80 and either agility or speed > 7 10 Forward height 78, agility 6 speed > 5 8 Forward height 77, agility 5 6 Forward height 76, speed > 4 S Forward height: 75 and either agility> 3 or speed > 3 3 Forward height 74 1 Forward 0 Guard height 78, ball handling > 7 and either agility or speed 7 10 Guard height 76 ball handling > 7 and either agility or speed > 6 8 Guard height 74, ball handling > 5, agility > 5. speed > 6 6 Guard ball handling > 6, agility> 6 speed > 5 4 Guard ball handling > 4, agility > 4 2 Guard 0 NOTE: cmpty other conditions" mean any values". these would be used in else clauses Figure 1: Basketball Player get Value Method Implementation Information Part 4 In the Basketball Player class, create a toString which returns the name, position, team and the value returned from the getValue method in Part 3 2 / 4 100% + Part 5 Create a class named College BasketballPlayer that extends Basketball Player. The class should have two private instance variables: . eligibility Remaining (int) role (String) Get and set methods should be created for each variable, Part 6 In the College Basketball Player class, create 3 different constructors Constructor 1: 0-argument constructor that make use of the O-argument constructor in the Basket- ball Player claws and mtx eligibilityRemaining to 4 and role to "bench" 2 . Constructor 2: 3-argument constructor (name, position, team) that makes use of the 3-argument constructor in the Basketball Player class and sets eligibility Remaining to 4 and role to "bench" Constructor 3: 10-argument constructor that receives all arguments and makes use of the 8-argument constructor from the Basketball Player claw Part 7 In the College Basketball Player class, add a method called draftable which returns true (boolean) if the player is a "starter" (role) whose value is greater than 1 or is a "bench" player (role) whose value is at least 8. Part 8 In the College Basketball Player class, create a new toString method which return a String containing all the information from the toString method of the Basketball Player class along with the eligibilityRemaining and role values for the player Part 9 Create a clownamed ProBasketball player that extends Baseball Player. The claw with two private instance variables yearsin league (int) role (String) Get and set methods should be created for each variable Part 10 In the ProBasketball player class, create 3 different constructoni: . Constructor 1: Oargument constructor that make use of the O-argument constructor in the Basket ball Player clows and sets year in League to 0 and role to "bench . Constructor 2: 3-argument constructor (name, position, team that makes use of the 3-argument constructor in the Basketball Player class and sets yearsInLengue to 0 and role to "beach" Constructor 3: 10-argument constructor that receives allargarments and makes use of the 8-argument constructor from the Basketball Player class that men of the Samen constructor in the Basketball player class and set years In League to 0 and role to "bench" Constructor 3 16-argument constructor that receives all arguments and makes use of the argument constructor from the Basketball Player Part 11 In the ProBasketball player cles, implement a method called newContract Value which returns an int value based on the logic in the following table, Value(using getValue Years in League Role 10 >7 > >5 10 Starter Starter Starter Starter Starter Starter Bench Bench Bench Bench Bench Retum value 0 12.000.000 10.000.000 8,000,000 6.000.000 2.000.000 1,000,000 7.500,000 5.000.000 4.5ODLODO 2.OOL000 500.000 TO > >7 >3 10 >>7 Figure 2. Pro Basketball Player was the implementation Information Part 12 - 4 73% Bench Bench DURDU 2,000,000 500,000 Figure 2. Pro Basketball Player newContract Method Implementation Information Part 12 In the ProBasketball player close, create a new toString method which return a String containing all the information from the toString method of the Buitball player chwalong with the yearsileague and robe value for the player Part 13 Create a cleaned Bathallester. Create a main method that read in the information from CBP.OW and PBP.com. Each row of information should be stored as collemelasketball player object (CBPO) ProBasketball Player object (PBP.). Adil each new College Basketball Player olject to an ArrayList named ebPlayers and add euch nur ProBasketball Player objet to an ArrayList named pbPlayers Part 14 Create a method in the Basketball Tester class named bestCBPal. The method sbotld accept an ArrayList of College Basketball Player objects. The method should return a String with the name and value of the player with the highest val determined by the set Value method of the Broothall Player class. The format of the String is left to you. You must es an enhanced for-loop in your implementation Part 15 Create a method in the BasketbalTester class named bestPBPcontract. The method should accept an ArrayList of ProBasketball Player objects and String The String argument indicates the role of the player (eg starter or bench). The toethod should return a String with the name and contract value of the player with the highest contract wule in the role given as an argument to the method. The format of the String is left to you. You must us an enhanced for-loop in your implementation Part 16 In the main method of the BasketbalTester call both the best CBP value and bestPBP contract thods with chPlayers and pbPlayers. When calling the best PBP contract method, use "Starter" as the String went. Print the String returned from each method to the screen. PP - Data View Formulas Review Help File Draw Power Pivot Home Page Layout X C - 11 % 13 Conditional Formatting formatas Table CellStyles Ting B 1 A Ali Number Cid Font Styles POSSIBLE DATA LOSS Some fatores might be fout if you are this workbook in the commandemed (av format to preserve the feature, save it in an Excel format 1 Name A1 G Speed Name Kevin Durant 3 Joakim Noah 4Dwight Howard 5 Stephen Curry 6 Andre quodala 7 Lonzo Ball 8 9 10 11 12 Position Team PS Brooklyn Nets c LA Clippers Philadelphia 76ers PG Golden State Warriors SF Miami Heat PG New Orleans Pelicans D Height Weight Agility 82 240 83 230 82 265 75 185 78 215 78 190 H Ball Hande Years In Le Role 8 & 12 Starter 6 6 13 Bench 6 6 16 Bench 9 10 11 Starter 8 8 16 Bench 8 9 3 Starter 7 9 7 8 14 15 15 17 18 19 30 PUP 16 09 7 CEP a Home Draw Insert Formulas Review Data Page Layout Power Pot View Help Ch % Ally Nur Conditional Formatting 15 formatas labies B 1 U. A A POSSIBLE DATA LOSS Some feature might be lost if you are the workbook in the commented (w) format topste them se fo 6 Speed 7 8 1 Name 2. La Garza 3 Isiah Mosley 4 Iustin Champagne 5. Davonte Gaines 6 Austin Davis Eric Dion D Position Team Height Weight Agility F lowa Buckeyes 265 F Missouri State Bears 77 201 G Pittsburgh Panthers 78 200 Tennessee Volunteers 29 181 Michigan Wolverines 32 250 F Villanova Wildcats 80 260 Ball Handibility role 7 7 Starter 8 B 2 Starter 9 9 2 Starter 7 7 2 Bench 5 5 Bench 5 Bench F 5 5 3 9 10 11 12 13 14 15 TG 11 10 CRP

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

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago