Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, shimmerandshine1
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print
Answers: 3
image
Computers and Technology, 23.06.2019 06:30, jayjay5246
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
image
Computers and Technology, 23.06.2019 22:20, kandi2565
What is a programming method that provides for interactive modules to a website?
Answers: 1
image
Computers and Technology, 24.06.2019 19:20, boyancecristina
Which command suppresses the visibility of a particular row or column in a worksheet?
Answers: 1
Do you know the correct answer?
Use Java please! class Mascara
Our Mascara class will include the following:
-forShortL...

Questions in other subjects:

Konu
History, 25.01.2021 20:50