{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw8 - int i = 0 for(int i = 0 i< 54 i double q = i...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 302 Homework 8 - Due Thursday, July 21 Name: 1. Suppose you are designing an object-oriented application that is supposed to simulate a library. Draw a class diagram (with low coupling) that indicates how you would choose classes. Recall that an arrow represents a “has a” or “has some” relationship (ie a CashRegister has some Coin objects). You should have at least six classes. 2. Circle three errors in the following code and explain why they are errors.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: int i = 0; for(int i = 0; i < 54; i++) { double q = i * Math.PI; if (q < Math.E) { double p = q * i; } q *= p; } System.out.println("q: " + q); 3. Declare the following: (a) a static Feld of type int named numBoxes that is initialized to ; (b) a static method named addBoxes that takes in an int and adds that number to the static Feld numBoxes ....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online