subject

Please write a code for ALL 3 constuctors that are needed If you aren't familiar with piratas, according to Wikipedia, a pinata is a shape or animal made out of paper mache and is filled with candy or toys. People take turns trying to break open the pinata while wearing a blindfold! The class only has a constructor without parameters. Your job is to add three more constructors so the user can design their own pinatas: 8 9 10 - 11 12 13 14 15 16 17 // Constructor without parameters public Pinata() { candy = "hard candy": color="rainbow": shape = "donkey": ) I 19 20 21 22 23 24 25 26 27 // Add an overloaded constructor that allows the user Il to customize all of the instance variables public static void main(String[]args) ( Scanner input; input = new Scanner(System. in); System. out. println("Enter the candy type"); String str - Scanner. nextInt(); input = new Scanner(System. in); System. out. println("Enter the color type"); String str Scanner. nextInt(); input-new Scanner(System. in);
1. A constructor that allows users to customize all the instance variables,
2. A constructor that allows users to customize the color and the shape
3. A constructor that allows users to customize the candy You can see the descriptions in the Pinata class.
You can also see how the constructors should be able to be used in Pinatatester. java Note: The additional constructors will take values as formal parameters. You do not need to prompt the user for these values After you make the constructors, you should be able to run your program without changing code In PinataTester. java In the constructors, use the default values given in the default constructors to till in any values that were not passed as parameters

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 23.06.2019 09:10
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
How often does colleges update the cost of attendance on their website? . a)every two years b) every four years c) every year d) every semester
Answers: 1
You know the right answer?
Please write a code for ALL 3 constuctors that are needed If you aren't familiar with piratas, acco...
Questions
question
History, 20.09.2020 06:01