subject

Use Java please! class Mascara
Our Mascara class will include the following:
-forShortLashes: boolean
-forThinLashes: boolean
-forStraightLashes: boolean
-waterProof: boolean
-brand: String
+Mascara(String, boolean, boolean, boolean, boolean)
+setInfo(boolean, boolean, boolean, boolean): void
+getBrandName(): String
+isForShortLashes(): boolean
+isForThinLashes(): boolean
+isForStraightLashes(): boolean
+isWaterProof(): boolean
+getInfo(): String
+toString(): String
• Constructor: brand is used to uniquely identify a mascara brand, while the remaining parameters all
represent different uses of a mascara: if forShortLashes is true, the mascara is best for short lashes; if
forThinLashes is true, the mascara is best for thin lashes; if forStraightLashes is true, the mascara is best for
straight lashes; if waterProof is true, the mascara is water proof.
• A void method called setInfo for setting the information after object creation with the parameter list:
boolean forShortLashes, boolean forThinLashes, boolean forStraightLashes, boolean waterProof.
• A getter called getBrandName for the brand. We do not need a setter because we do not expect to change
the brand after it is set.
• Methods isForShortLashes(), isForThinLashes(), isForStraightLashes(), isWaterProof(), each of which
take no parameters and return boolean. These methods indicate which lash types the mascara is good for.
These might be redefined in subclasses, but for now, each of these methods should return whatever the boolean
attributes were set to.
• A getInfo method that takes no parameters and returns a String containing each of the features of the
mascara separated by spaces. For example, if isForShortLashes() is true only, the string will return: Short
Lashes. If isForShortLashes() and isForThinLashes() is true, the string returned is: Short Lashes Thin Lashes.
If all of them are true, the string will return: Short Lashes Thin Lashes Straight Lashes +Water Proof {may
clump during application, require more time to dry}
*As you can see if isWaterProof() is true, the string is a little longer. Pay attention to the exact string returned.
If none of them return true, the empty string should be returned ("").
NOTE: in order for this method to work correctly for subclasses, you should use the previously defined
isForShortLashes(), isForThinLashes(), isForStraightLashes(), isWaterProof() methods rather than access any
data members directly.
• A toString method which returns a String in the format "Brand: , Good For: "
(replacing with actual brand and list of features).

class VolumizingMascara
Our VolumizingMascara class will include the following:
+VolumizingMascara(String, boolean)
+isForShortLashes(): boolean
+isForThinLashes(): boolean
+isForStraightLashes(): boolean
• Extend the Mascara class.
• An overloaded constructor with just two parameters: String brand, boolean waterProof
• An overridden isForShortLashes() method which always returns false.
• An overridden isForThinLashes() method which always returns true;
• An overridden isForStraightLashes() method which always returns false;
NOTE: this class does not define or override the getInfo method, but it is still inherited by this subclass, and
it should still give the correct output when on instances of this subclass. If you've followed the note above,
this will be the case.

class LengtheningMascara
Our LengtheningMascara class will include the following:
+LengtheningMascara(String, boolean)
+needsMultipleCoats(): boolean
+isForShortLashes(): boolean
+isForThinLashes(): boolean
+isForStraightLashes(): boolean
+getInfo(): String
• Extend the Mascara class.
• An overloaded constructor with just two parameters: String brand, boolean waterProof
• A new method, needsMultipleCoats() which takes no arguments and returns true.
• An overridden isForShortLashes() method which always returns true.
• An overridden isForThinLashes() method which always returns false;
• An overridden isForStraightLashes() method which always returns false;
• An overridden getInfo method which returns a string in the same format as the parent class Mascara
but with the additional +Needs Multiple Coats at the end.
Please solve these first 3 classes. There's 3 more which I'll post in a separate question and will put it in the comments. Comments in code is appreciated.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Which is produced by the endocrine system to control how cells and organs function
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
You know the right answer?
Use Java please! class Mascara
Our Mascara class will include the following:
-forShortL...
Questions
question
Mathematics, 03.12.2021 17:40
question
Mathematics, 03.12.2021 17:40
Questions on the website: 13722367