Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how i can simplify this netbeans program that demonstrates inheritance 23 24 25 26 pfExceptions1 pfExecutionControl pfforloops pfGreetings v pfinterfaces 1 Source Packages EJ pfinterfaces

how i can simplify this netbeans program that demonstrates inheritance

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

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

image text in transcribed

23 24 25 26 pfExceptions1 pfExecutionControl pfforloops pfGreetings v pfinterfaces 1 Source Packages EJ pfinterfaces Keene.java Management java 28 29 30 NYCjava Osterville java Pfinterfaces.java ibraries pfLetterCount pfMultiplicationTable 32 9 package pfboats 10 public class Boat 13 14 15 16 17 18 19 20 21 protected String strMake, strModel, strType, strHull; protected int intYear, intLength; public Boat (string strMake, String strModel, int intYear, int intLength, string str this. strake = strake; this.strModel strModel; this.strTypestrType; this.strHullstrHull; this. intYea r intYear; this. int Length = ntLength; 23 24 25 13 14 strModel, strType, strHull; 15 tLength; 16 17 e, String strModel, int intYear, int intlength, String strType, String strHull ) 18 19 ike; 20 odel; 21 pe; 22 ll; 23 ari 24 Length; 25 23 24 25 26 this.strHull strHull; this. intYea r = intYear; this.intLength intLength; public String getstrType) t 28 29 return strType; 30 public void setStrType(String strType) f 32 this.strTypestrType 34 35 P public String getstrHull) f 36 37 38 39 40 41 42 43 return strHull; public void setstrHull(string strull) ( this.strHull strHull; 45 11 public String getStrMake() f 46 return strMake; 21:30 42 43 45: 46 47 48 49 50 51 52 53Ppublic String getstrModel() 54 public string getStrMake) returni strMake; public void setStrMake (String strMake) f this. strMake strMake; return strModel; 56 57 public void setstrModel (String strModel) 58 59 60 61 62 ( this. strModel = strModel; public int getIntYear) return intYear; 1 00I0 SetiitYearint intYear) this. intYear = intYear; 67 68 public int getIntLength) f return intLength 70 71 72 73 74 75 76 public void setIntLength(int intlength) f this. int Length ntLength; @override public String toString) f return "Boatf" "strMake"strMake+ ", strModel-" strModel", 79 80 81 82 83 END OF CLASS. 73 74 75 76 79 trModel-"strModel", intYear" intYear +", intLengthe"intLength" 80 81 82 83 73 74 75 76 79 , intYeara" + intYear + ", int Length:" + intLength +"; 80 81 82 83 2 Application Title: 3 Author: 4 ISCS 140, Programming Foundations I 5 Date: 6 Purpose: 9 package pfboats; 10 12 public class HumanPowered extends Boat 13 14 15 16 17 18 19 String strPrppulsion; public HumanPowered (String strMake, String strModel, int intYear, int intLength, 16 public HumanPowered (String strMake, 17 18 19 20 21 String strModel, int intYear, int intLength, String strType, String strPropulsion, String strHull) 23 24 25 26 27 28 public String getStrPropulsion() 29 30 31 super (strMake, strModel, intYear, intLength, strType this.strPropulsion strPropulsion; return strPropulsion; 16 strMake, 17 g strModel, 18 ntYear 19 ntLength, 20 g strType, 21 g strPropulsion, 22 g strHull) 23 24 lel, intYear, intLength, strType, strHull); 25 strPropulsion; 26 27 28 Lsion() 29 30 31 super strMake, strModel, intYear, intLength, strTyp this.strPropulsionstrPropulsion; 25 26 27 28" public String getStrPropulsion() { 29 30 31 32 public void setStrPropulsion (String strPropulsion) f return strPropulsion; this. StrPropulsion = strPropulsion; 34 35 36 @Override public String toString()f return "HumanPowered: "+ 38 39 "Propulsion: " strPropulsion + "Make: "strMake+ 40 Application Title: Author: ISCS 140, Programming Foundations I *Date: Purpose: 9 package pfboats; 12 public class PowerBoat extends Boat 3 14 15 16 17 18 19 20 21 protected String strPropulsion; public PowerBoat(String strMake, String strModel, int intYear, int intLength, String strType, String Propulsion, String strHull) 23 24 25 super ( strMake, strModel, intYear, intLength, strType, strHull): this.strPropulsion Propulsion; 19 int intlength, String strType, String Propulsion, String strHull) 21 23 24 25 super(st rMake, strModel, ntYear, this.strPropulsionPropulsion; int Length, st rType, strHull); 27 29 31 public String getstrType() return strType: public void setstrType(String strType) f 35 this.strType strType; 37 38 public String getStrPropulsionO return strPropulsion; public void setStrPropulsion(String strPropulsion) f 43 this.strPropulsionstrPropulsion

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions