Java Reference
In-Depth Information
΢΢ Exercise P12.9. Modify the implementations of the class in the ATM
example so that the bank manages a collection of bank accounts and a
separate collection of customers. Allow joint accounts in which some
accounts can have more than one customer.
΢΢΢ Exercise P12.10. Write a program that administers and grades quizzes.
A quiz consists of questions. There are four types of questions: text
questions, number questions, choice questions with a single answer, and
choice questions with multiple answers. When grading a text question,
ignore leading or trailing spaces and letter case. When grading a numeric
question, accept a response that is approximately the same as the answer.
A quiz is specified in a text file. Each question starts with a letter
indicating the question type (T, N, S, M), followed by a line containing
the question text. The next line of a non-choice question contains the
answer. Choice questions have a list of choices that is terminated by a
blank line. Each choice starts with + (correct) or ɨ (incorrect). Here is a
sample file:
T
Which Java keyword is used to define a subclass?
extends
S
What is the original name of the Java language?
- *7
- C--
+ Oak
- Gosling
M
Which of the following types are supertypes of
Rectangle?
- PrintStream
+ Shape
+ RectangularShape
+ Object
- String
N
What is the square root of 2?
1.41421356
Search WWH ::




Custom Search