Question: D Question 1 5 pts How many constructors does this class have? Refer to the following UML Class Diagram when answering this question. Pet name

 D Question 1 5 pts How many constructors does this classhave? Refer to the following UML Class Diagram when answering this question.Pet name : int + age : String + hasFleas : Boolean- licenseNumber : String + weight : float color : String Pet( ) + Pet(name : String, age : int) + getName( )

D Question 1 5 pts How many constructors does this class have? Refer to the following UML Class Diagram when answering this question. Pet name : int + age : String + hasFleas : Boolean - licenseNumber : String + weight : float color : String Pet ( ) + Pet(name : String, age : int) + getName( ) : String + setName (name : String) : void getAge ( ) : int setAge (age : int) : void + speak() : void + scratch(itches : int) : void + toString() : StringD Question 2 5 pts How many public members does this class have (not including constructors)? Refer to the following UML Class Diagram when answering this question. Pet name : int age : String - hasFleas : Boolean + licenseNumber : String + weight : float + Pet ( ) + Pet(name : String, age : int) + getName() : String - setName (name : String) : void + getAge () : int setAge (age : int) : void + speak() : void - scratch(itches : int) : void + toString() : StringD Question 9 5 pts Evaluate the following code to determine the output. MyStack s = new MyStack (); s. push(38); s. push(51); s. push(96); 5 . pop ( ); 5. Pop ( ) ; System. out . printIn(s . pop ( ) ) ; D Question 10 5 pts Evaluate the following code to determine the output. MyStack s = new MyStack( ); s. push(28); s. push(68); s. push(86); System. out . printIn(s . pop ( ) ) ; D Question 11 5 pts Evaluate the following code to determine the output. MyQueue q = new MyQueue( ); q . add(20); q. add(43) ; q. add(74); System. out . printIn(q. remove ( ) ) ;U Question 12 5 pts Evaluate the following code to determine what value will be at the back of the queue after the code completes. MyQueue q = new MyQueuej5 q.add(31); q.add(61}; q.add(81); Question 13 5 pts Given the following partial code, ll in the blank to complete the code necessary to remove last node. (don't forget the semicolon) class Node { public Object data = null; public Node next = null; } Node head = new Node()} If first Node head.next = new Node()} If second Node head.next.next = new Node()i ff third node head.next.next.next = new NodE(}; fl tourth node fl D Question 14 5 pts Given the following partial code, fill in the blank to complete the code necessary to insert node x before the first node. (don't forget the semicolon) class Node { public Object data = null; public Node next = null; . . . Node head = new Node(); // first Node head. next = new Node(); // second Node head . next. next = new Node(); // third node Node x = new Node(); // node to insert 11 head = x; head.next.next. next = x

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!