Skip to content

Design a class named?yAndroid. The class?ontains:* A priva

Do you have a similar question? Our professional writers have done a similar paper in past. Give Us your instructions and wait for a professional assignment!        

Design a class named?yAndroid. The class?ontains:* A private int?ata field named id?hat stores?he id number for the android. This number must be associated with the object when created.* A private data field for name* A private data field for Sex (MyAndroid.MALE, MyAndroid.FEMALE, MyAndroid.OTHER)* A private data field for age* A private data field of your choosing (something other than what is already defined, this will be used to differentiate your program from others : Be Creative! )* A private variable for height (MyAndroid.SHORT, MyAndroid.MEDIUM, MyAndroid.TALL)* A private variable for weight (MyAndroid.HEAVY, MyAndroid.MEDIUM, MyAndroid.LIGHT)* A static final constant for SHORT = 1* A static final constant for MEDIUM = 2* A static final constant for TALL = 3* A static final constant for HEAVY = 1* A static final constant for LIGHT = 3* A static final constant for MALE = 3* A static final constant for FEMALE = 2* A static final constant for OTHER = 1* A constructor?hat creates a MyAndroid object with all default attributes other than id (pass in id).* A constructor?hat creates a MyAndroid object with all attributes defined when the object is created.* The methods?sMale(), isFemale(), and isOther() that return true?f the sex?n this object?s Male, Female, or Other, respectively.* The static methods?sMale(int), isFemale(int), and isOther(int) that return true?f the specified sex?s Male, Female, or Other, respectively.* The static methods?sMale(MyAndroid), isFemale(MyAndroid), and isOther(MyAndroid) that return true?f the specified sex?s Male, Female,or Other, respectively.* The method sameAge(MyAndroid) that return true?f the age?n this object?s equal?o the age of another object.* The method sameAge(int) that return true if the age in this object is equal to the specified value.* The method generatePrice() based on age, weight, and height of the Android.* The method speak() that returns the Androids id and name in a greeting.? A method of your choosing (something other than what is already defined, this will be used to differentiate your program from others : Be Creative! )* Override toString to output all attributes (output must be user readable ie. Male, female, other, tall, medium, short, light, heavy).??Example?don’t forget to include your unique attribute, not shown here)?Name: Tessa?ID: 45345?Sex: female?Age: 36?Height: tall?Weight: medium* All appropriate setters and getters for each attribute.?rite a test program (in a different file from your object) that allows a user to create and purchase their Android.Print a confirmation that outputs all attributes of the created and purchased Android.Output a greeting from the newly created android.Computer ScienceEngineering & TechnologyJava ProgrammingCOMPUTER SCIENCE 2

Get a plagiarism-free order today   we guarantee confidentiality and a professional paper and we will meet the deadline.    

Leave a Reply

Order a plagiarism free paper today. Get 20% off your first order!

X