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, 22.06.2019 09:00
Create a cell reference in a formula by typing in the cell name or         a. right-clicking the cell. b. clicking the cell. c. clicking the column where the cell is located. d. clicking the row where the cell is located.
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
According to alisa miller foreign news bureaus
Answers: 3
question
Computers and Technology, 23.06.2019 10:50
The volume v and paper surface area a of a conical paper cup are given by where r is the radius of the base of the cone and h is the height of the cone. a. by eliminating h, obtain the expression for a as a function of r and v. b. create a user-de ned function that accepts r as the only argument and computes a for a given value of v. declare v to be global within the function. c. for v ! 10 in.3 , use the function with the fminbnd function to compute the value of r that minimizes the area a. what is the corresponding value of the height h? investigate the sensitivity of the solution by plotting v versus r. how much can r vary about its optimal value before the area increases 10 percent above its minimum value?
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Under the home tab, where can a user find options to change the bullet style of an outline? in the slides group in the font group in the paragraph group in the drawing group
Answers: 1
You know the right answer?
Use Java please! class Mascara
Our Mascara class will include the following:
-forShortL...
Questions
question
Mathematics, 14.07.2019 10:00
question
Geography, 14.07.2019 10:00
Questions on the website: 13722363