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 02:50
Define a class named movie. include private fields for the title,year, and name of the director. include three public functions withprototypes void movie: : settitle(cstring); , voidmovie: : setyear(int); , void movie: : setdirector(string); . includeanother function that displays all the information about a movie.write a main() function that declares a movie object namedmyfavoritemovie. set and display the object's fields.this is what i have but know its wrong since it will notcompile: #include#includeusing namespace std; //class declarationclass movie{private: string movietitle ; string movieyear; string directorname; public: void settitle(string title); void setyear(string year); void setdirector(string director); void displayinfo(); }; //class implementationvoid movie: : settitle(string title){ movietitle = title; cout< < "what is the title of themovie? "< > temp; myfavoritemovie.settitle(temp); cout< < "enter movie year"< > temp; myfavoritemovie.setyear(temp); cout< < "enter director'sname"< > temp; myfavoritemovie.setdirector(temp); //display all the data myfavoritemovie.displayinfo(); system("pause"); return 0; this code is not entirely mine someone on cramster edited my firstcode but then i try manipulating the new code and i still get acompile error message : \documents\visual studio 2008\projects\movie\movie\movie.cpp(46) : error c2679: binary '< < ' : no operator found which takes aright-hand operand of type 'std: : string' (or there is no acceptableconversion)c: \program files (x86)\microsoft visual studio9.0\vc\include\ostream(653): could be'std: : basic_ostream< _elem,_traits> & std: : operator< < > (std: : basic_ostream< _elem,_traits> & ,const char *)w
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
What questions about an audience should be asked during presentation preparation? check all that apply. what does the audience already know about the topic? how will multimedia tools inspire the audience? is the information interesting and engaging? how will this information affect the presentation? will the audience change the message’s purpose? what is likely to interest the audience?
Answers: 3
question
Computers and Technology, 24.06.2019 22:10
How many different ways are there to order the eight jobs in the queue so that job usu comes somewhere before cdp in the queue (although not necessarily immediately before) and cdp comes somewhere before bbd (again, not necessarily immediately before)?
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
Mathematics, 05.05.2020 06:26
question
Mathematics, 05.05.2020 06:26
question
Spanish, 05.05.2020 06:26
question
Chemistry, 05.05.2020 06:26
Questions on the website: 13722361