Quiz 03 (Part 2)_ CSE 205_ H-T-CSE205-SP24

pdf

School

Arizona State University *

*We aren’t endorsed by this school

Course

205

Subject

Computer Science

Date

Feb 20, 2024

Type

pdf

Pages

7

Uploaded by BarristerFlag12929

Report
2/18/24, 4:53 PM Quiz 03 (Part 2): CSE 205: H-T-CSE205-SP24 https://canvas.asu.edu/courses/175602/quizzes/1321125?module_item_id=12557618 1/7 Quiz 03 (Part 2) Due Feb 11 at 11:59pm Points 100 Questions 20 Available until Apr 28 at 11:59pm Time Limit 20 Minutes Allowed Attempts 3 Instructions You may take this quiz 3 times before the due date passes The questions will be different each time you take it Your highest score will be recorded in the Canvas Grades No extensions of the due date will be granted for any missed quiz This quiz has a 30 minute time limit If you are not able to successfully answer all questions within the time limit, then you may need more study and practice This quiz covers the following topics: Arrays OOP UML IMPORTANT: This assignment is due before the Due date listed on this page. The Available until date is not the due date. No points may be awarded for any work that is submitted after the Due date. As stated in the syllabus due dates will not be extended or excused.
2/18/24, 4:53 PM Quiz 03 (Part 2): CSE 205: H-T-CSE205-SP24 https://canvas.asu.edu/courses/175602/quizzes/1321125?module_item_id=12557618 2/7 Attempt History Attempt Time Score KEPT Attempt 3 20 minutes 90 out of 100 LATEST Attempt 3 20 minutes 90 out of 100 Attempt 2 18 minutes 90 out of 100 Attempt 1 15 minutes 80 out of 100 Correct answers are hidden. Score for this attempt: 90 out of 100 Submitted Feb 11 at 5:22pm This attempt took 20 minutes. Question 1 5 / 5 pts True False Question 2 5 / 5 pts my_array = int[]; int[] my_array; my_array[] = int[]; none of these int my_array; Question 3 5 / 5 pts curly brace parenthesis period none of these In Java, arrays can only store primitive types. Which of the following would declare an array of integers in Java? Choose all that apply. Java statements generally end with a _____.
2/18/24, 4:53 PM Quiz 03 (Part 2): CSE 205: H-T-CSE205-SP24 https://canvas.asu.edu/courses/175602/quizzes/1321125?module_item_id=12557618 3/7 colon Question 4 5 / 5 pts end retrieve eval none of these send Question 5 5 / 5 pts True False Question 6 5 / 5 pts static void local global Question 7 5 / 5 pts True False Question 8 5 / 5 pts True Java uses the keyword _____ to return a value from a method. In Java all variables must be declared with their data type. In Java class members are declared with the keyword _____. Objects encapsulate state. We can more easily debug a program when the responsibilities are well encapsulated.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
2/18/24, 4:53 PM Quiz 03 (Part 2): CSE 205: H-T-CSE205-SP24 https://canvas.asu.edu/courses/175602/quizzes/1321125?module_item_id=12557618 4/7 False Question 9 5 / 5 pts True False Question 10 5 / 5 pts True False Question 11 5 / 5 pts True False Question 12 5 / 5 pts none of these expression class reference value Question 13 5 / 5 pts Data hiding helps make encapsulation work. Responsibilities that are very closely related can and should generally be assigned to a single class. A variable of a primitive type can never be null. A value type variable stores a _____. Evaluate the following code to determine the output. class Foo { public int i = 98; public Foo(int i) { this.i = i;
2/18/24, 4:53 PM Quiz 03 (Part 2): CSE 205: H-T-CSE205-SP24 https://canvas.asu.edu/courses/175602/quizzes/1321125?module_item_id=12557618 5/7 82 Question 14 5 / 5 pts 36 Question 15 5 / 5 pts True False Question 16 5 / 5 pts True False Question 17 5 / 5 pts } } ... Foo x = new Foo(87), y = new Foo(82); x.i = y.i; y.i = 14; System.out.println(x.i); Evaluate the following code to determine the output. class Foo { public int i = 74; public Foo(int i) { this.i = i; } } ... Foo x = new Foo(74), y = new Foo(31); y = x; y.i = 36; System.out.println(x.i); An “has a” relationship is implemented by composition. When creating a sub-class, all methods of the super class must be overridden. The "extends" keyword is not used to specify inheritance in Java.
2/18/24, 4:53 PM Quiz 03 (Part 2): CSE 205: H-T-CSE205-SP24 https://canvas.asu.edu/courses/175602/quizzes/1321125?module_item_id=12557618 6/7 True False Question 18 5 / 5 pts True False IncorrectQuestion 19 0 / 5 pts 3 IncorrectQuestion 20 0 / 5 pts A sub-class has no access to private instance variables of its super class. How many private members 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 + 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() : String How many instance variables does this class have? Refer to the following UML Class Diagram when answering this question.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
2/18/24, 4:53 PM Quiz 03 (Part 2): CSE 205: H-T-CSE205-SP24 https://canvas.asu.edu/courses/175602/quizzes/1321125?module_item_id=12557618 7/7 5 Quiz Score: 90 out of 100 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() : String