quiz2_questions

quiz2_questions - 1.00 Introduction to Computers and...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1.00 Introduction to Computers and Engineering Problem Solving Quiz 2 – April 15, 2005 Name: E-mail Address: TA: Section: You have 80 minutes to complete this exam. For coding questions, you do not need to include comments, and you should assume that all necessary files have already been imported. Question Points 1. Inheritance /10 2. Inheritance /15 3. Matrix, exception /20 4. Recursion /20 5. Swing /35 Total /100 HW1 HW2 HW3 HW4 HW5 HW6 Page 1 of 11
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Question 1. Short answer/true-false: Inheritance (10 points) 1. A class can inherit from multiple abstract classes. Circle TRUE or FALSE. TRUE FALSE 2. A class can implement multiple interfaces. Circle TRUE or FALSE TRUE FALSE 3. What is the default visibility of the methods in an interface? Circle the correct answer. a. public b. protected c. private d. package 4. A subclass may call any non-private superclass method someMethod that has no arguments by using the syntax super().someMethod(); TRUE FALSE 5. If a subclass is derived from a superclass that has an abstract method, and if no definition is supplied in the subclass for that abstract method, then the subclass must be declared as an abstract class TRUE FALSE / DO NOT WRITE HERE – FOR GRADERS ONLY Points awarded: 10 Page 2 of 11
Background image of page 2
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 Question 2. Inheritance (15 points) The Account class given below has characteristics similar to those of a bank account. Line No 10 11 12 13 14 public class Account { private double balance; public Account(double openingBalance) { balance = openingBalance; } public void deposit(double amt) { balance += amt; } public final double getPrevBalance(double amt) {
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

quiz2_questions - 1.00 Introduction to Computers and...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online