| CSC 8310 Midterm Exam Fall 2000, Villanova University David Matuszek |
Name ____________________________________ |
Please keep all answers short and to the point, and don't provide any information that wasn't asked for. There are no essay questions on this exam.
Prolog
Able = Baker
mother(Bill) = mother(Sally)
loves(john, mary) = loves(mary, john)
husband(John, Mary) = wife(Mary, John)
spouse(John, Mary) = spouse(father(Bill), mother(Bill))
father(mother(bill)) = father(Jane)
child(Mary, mother(Bill)) = child(child(Bill), Mary)
child(child(Sally), mother(Bill)) = child(child(John), Sally)
Mary = mother(child(Mary))
loves(john, _) = loves(_, mary)
son(Son, Mother, Father). /*
Example: son(bill, mary, john). */
daughter(Daughter, Mother, Father). /* Example: daughter(sally,
mary, john). */
female(X)
mate(X, Y) /* X and Y are parents of some child */
childless(X) /* X has no children */
different(X, Y) /* X and Y are not the same */
siblings(X, Y) /* X and Y are different people with at least one parent in
common */Java
static variable) and an instance variable? class B extends class
A;
class C extends class A;
A a; B b; C c;
For each of the following assignment statements, put a checkmark by
the statement if it is legal, correct it if it can be made legal, or cross
it out if it is illegal and can't be fixed.a = b;
b = c;
c = a;
try...catch statement?javadoc?Applet, Component, Container, Object,
Panel.main method of a class has a very specific form
that you were asked to memorize. Write a main method with an
empty body (that is, use {} for the body).<applet> tag.General
<ynum>, where a
<ynum> is a four-digit integer in the range 0000
to 3000, inclusive. Assume that <digit> has
already been defined.