W12:Exams:E02

From 56wiki

Jump to: navigation, search

Contents

[hide]

What is covered?

  • Homeworks: H00 through H14, with emphasis on H09 to H14.
  • Lectures from start of course to Feb 28(for code, see: http://www.cs.ucsb.edu/~pconrad/cs56/12W/lect/ )
  • Labs: lab00 through lab04
  • Textbook: Chapters 1 through 14, in HFJ, plus p. 560, and Chapter 17 (whole chapter, this time)
    • Emphasis on the newer chapters: 11-14, later part of Chapter 17 (JWS).


Notes Sheet?

yes: one 8.5 x 11 inch sheet of paper, you can use both sides, you can print it on a printer, or you can write it longhand.

No foldouts, no stickers.

Sample Exams

Here are some exams from past offerings of CS56 that you can look at to get an idea of the style of exam questions I typically write.

Note that there are things that cause exams to vary from quarter to quarter:

  • the pace of the class
  • the point at which the midterm is scheduled
  • what material was emphasized in lecture, labs and homeworks

So understand that the coverages for these exams as NOT identical to the exam you should expect. In fact, we have covered slightly more material than the 2nd midterm exam example shown below.



Exam Chapters Covered
W11 E01 01-04, parts of 17
W11 E02 01-13, parts of 17
S11 E01 01-08, all of 17
S11 E02 01-13, p. 560, all of 17
S12 E02 (your exam) 01-14, p. 560, all of 17


Some more sample questions

1) Suppose we have the following code (in part... assume that all missing parts are completed properly...)

public class A implements B {
...

For each of the following lines of Java code, indicate whether the line is valid or invalid. Further, if it is invalid, explain why.

(a) A w = new A();

(b) A x = new B();

(c) B y = new A();

(d) B z = new B();


Hints:

  • because we have "implements B", we know that B is an interface. What do we know about creating instances of an interface?
  • As a specific example, suppose A is "Laptop" and B is "Shippable" Then, read the four statements. Does this help?
  • though I can't create an instance "Fooable" of an inteface with "new Fooable()", I can have a variable of type Fooable that refers to any object that implements the Fooable interface. With that variable, I can only invoke methods that are part of the Fooable interface.


2) Suppose we have the following code (in part... assume that all missing parts are completed properly...)

File D.java:

public abstract class D {
...
}

File: C.java:

public class C extends D {
...

For each of the following lines of Java code, indicate whether the line is valid or invalid. Further, if it is invalid, explain why.

(a) C w = new C();

(b) C x = new D();

(c) D y = new C();

(d) D z = new D();


Hints:

  • What do we know about creating instances of abstract classes?
  • As a specific example, suppose C is "Laptop" and D is "Product" Then, read the four statements. Does this help?

If you want more practice with inheritance, interfaces, exceptions, Swing before the exam...

You may want to look at "lab07" from Spring 11, which covers these topics:

S11:Labs:lab07

There are three options for this lab:

IF YOUR CHOICE POINTS PROJECT ISN'T GOING WELL: 
  • (1) "BAILING ON YOUR MANTIS TICKET": Complete it for credit by Friday 5pm INSTEAD of your assigned Mantis ticket (or if you don't have a Mantis ticket) and earn up to 150 choice points (here, 150 points are "lost choice points" in addition to whatever deductions are taken when the lab is graded". But this is better than earning a zero.
    • In this case, the TicTacToeGrid.java file will form the basis of your 2nd round of code reviews. You'll want to send just your TicTacToeGrid.java file by email to whoever is doing your 2nd round of code reviews, and to your code review Moderator---since this one is NOT an open source assignment, your reviewer will have no other way of seeing your code.

Note that this is also bailing on 150 choice points for the "redo" of this after the code review--because you'll only be eligible for 150 points at that time. as well. So only do this if you are seriously stuck on your Mantis Ticket.

You can still complete your original Mantis ticket for additional choice points by the final deadline of the quarter, which is the last day of instruction.

"IF YOUR CHOICE POINTS PROJECT IS IN GOOD SHAPE, BUT YOU WANT TO USE THIS LAB TO STUDY FOR THE EXAM":

  • (2) NO CREDIT OPTION: Just look it over to help you in your understanding of inheritance, interfaces, JUnit, layout managers, Swing, and user defined exceptions, but don't complete it for credit---only use it to study for the exam. Complete only the parts that you think will help you understand inheritance, interfaces, JUnit, layout managers, Swing, and user defined exceptions.
  • (3) "EXTRA CREDIT OPTION": Complete S11's lab07 for credit by Friday 5pm IN ADDITION TO your assigned Mantis ticket---submit it AFTER completing and submitting your Mantis ticket. You can earn up to 150 choice points on top of whatever you earn for your lab05c submission.

When you work on this, just call the directory "lab07".. that way we don't have to modify any of the instructions. We'll use the original grading rubric, but divide the points by 2 (rounding up) so that it is worth 150 points instead of 300. If we have a different lab07, we'll call it something else.