Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

1 Page

hw8

Course: CS 302, Spring 2005
School: Wisconsin
Rating:

Word Count: 137

Document Preview

302 CS 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 &quot;has a&quot; or &quot;has some&quot; relationship (ie a CashRegister has some Coin objects). You should have at least six...

Register Now

Unformatted Document Excerpt

Coursehero >> Wisconsin >> Wisconsin >> CS 302

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
302 CS 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 the in following code and explain why they are errors. 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 field of type int named numBoxes that is initialized to 0; (b) a static method named addBoxes that takes in an int and adds that number to the static field numBoxes.
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Wisconsin - CS - 302
CS 302 Homework 9 - Due Wednesday, July 27Name: 1. Given the specifications of Programming Assignment 5, list at least three classes you will write for this assignment. Also, identify each class as either an instantiable class or an main application
Wisconsin - ME - 419
Wisconsin - MATH - 113
Wisconsin - MATH - 130
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - CS - 302
CS 302 Homework 1 - Due Thursday, June 16Name: 1. Write a program (the entire Java code) that will print &quot;Super&quot; to the screen. Hint: Remember the simple program we did in class.2. Declare a variable of type int whose name is numCows.3. Declare
Wisconsin - MATH - 222
Wisconsin - MATH - 222
Wisconsin - CS - 302
CS 302 Homework 3 - Due Thursday, June 23Name: 1. Write an instantiable class named Bus that has the instance fields numPassengers and numSeats one constructor that takes one parameter, seats, that initializes the instance field numSeats (numPasse
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 113
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 211
Wisconsin - MATH - 221
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 222
Math 222, Quiz 11 Name: Instructions: Answer the following questions fully. 1) 2) Find the unit tangent vector T, the principal unit normal N, the curvature , and the binormal B, for the curve r(t) = cos t + t sin t, sin t - t cos t, 2 .T is cos t,
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - ECON - 464
Wisconsin - ECON - 464
Wisconsin - ECON - 464
Specific Factors Models: Argument to show that an increase in the endowment of the specific factor decreases the real return (per unit) of both specific factors. Assumptions: (1) 3 factors : labor (L, mobile) , land (T, specific to food sector ), cap
University of Texas - PSY - 341
Wisconsin - SS - 322
1NAME: SOIL SCIENCE 322 Physical Principles of Soil and Water Management Take Home Final Exam May 6, 2008 Due: May 15, 2007 Data for the final exam is located in a spread sheet under 2008FieldTripData (Excel spreadsheet), on the class web site: ( h
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 211
Wisconsin - MATH - 211
Wisconsin - SS - 322
SOIL TEMPERATURE AND HEAT FLOW IN SOILChapter 12 in Introduction to Environmental Soil PhysicsSoil temperature governs many soil physical and biological processes Soil temperature is a function of radiant, thermal and latent energy processesEqua
Wisconsin - SS - 322
SOIL SCIENCE 322 Problem Set #2 February 5, 2008Due February 12, 2008 1. (A). Calculate the maximum specific surface area per unit volume of -1. very fine sand and 2. silt for a soil assuming the USDA standard particle sizes for the soil. (B). What
Wisconsin - MATH - 130
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - CS - 302
Chapter 3 Implementing ClassesIntroduction In the previous chapter, we saw how to use objects Declare an object Book aBook; Create an object aBook = new Book(&quot;Beloved&quot;,&quot;Toni Morrison&quot;); Call methods on an object aBook.getAuthor();Introd
Wisconsin - MATH - 222
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 222
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 222
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - ME - 419
Wisconsin - MATH - 130
Wisconsin - MATH - 130
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - CS - 302
Chapter 2 Using ObjectsOverview This chapter touches briefly on topics we will discuss as the course progresses Objects main point of course First, learn about objects How to use objects we already know about Create objects Design classes t
Wisconsin - CS - 302
CS 302 Homework 6 - Due Monday, July 11Name: 1. Convert the following for loop into an equivalent set of instructions that only uses one while loop and no other types of loops. for(int i = 0; i &lt; 45; i+) { System.out.println(&quot;Looping&quot;); }2. How ma
Wisconsin - CS - 302
Exception Game Questions1. (100) What is the output if NumberFormatException occurs at line A? 2. (100) What is the output if NumberFormatException occurs at line B? 3. (100) What is the output if NumberFormatException occurs at line C? 4. (100) Wha
Wisconsin - CS - 302
CS 302 Final Review Answers1 True or False1. False 2. True 3. False 4. False 5. True 6. True 7. False 8. True 9. True 10. False 11. True2Multiple Choice12. B 13. B 14. A 15. C 16. B 17. A13Written Answers18. public int getLinesInFile(
Wisconsin - CS - 302
CS 302 Homework 5 - Due Wednesday, July 6Name: 1. The following piece of code has three errors. Circle each of the errors, and also describe how you would fix each error. Assume that x and y are variables of type int and have already been declared a
Wisconsin - CS - 302
CS 302 Homework 11 - Solution1. (a) Ship s = new CruiseShip(); (b) Yacht y = (Yacht) new Ship();2. public class Dog extends Pet { private String breed; public Dog(int theAge, String theName, String theBreed) { super(theAge, theName); breed = theBr
Wisconsin - CS - 302
CS 302 Homework 2 - Due Tuesday, June 21Name: 1. What type of variable would you use to store the value 1.23e-31?2. Is the toLowerCase method of the String class an accessor or mutator? Why?3. Write code to both declare and create a Rectangle ob
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - CS - 302
public class ExceptionExample { public static void main(String[] args) { foo(); try { bar(); } catch (IndexOutOfBoundsException iobe) { System.out.println(&quot;ERROR 1&quot;); } catch (ArithmeticException ae) { System.out.println(&quot;ERROR 2&quot;); } finally { Syste
Wisconsin - CS - 302
CS 302 Homework 4 - Due Wednesday, June 29Name: 1. Write a Java statement to store the decimal value of the fraction 1/7 in a variable of type double named seventh.2. Translate the following mathematical expressions into valid Java expressions: (N
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - CS - 302
CS 302 Homework 10 - Due Monday, August 1Name: 1. Write a method that given a filename, passed as a String parameter, returns a boolean that is true if the file exists and false otherwise.2. Write a method named writeArray that takes two parameter
Wisconsin - MATH - 211
Wisconsin - MATH - 130
Wisconsin - CS - 302
CS 302 Midterm Answers1 True or False1. False 2. False 3. False 4. False 5. False 6. True 7. True 8. False 9. False2Multiple Choice1. A 2. C 3. B 4. D1
Wisconsin - SS - 322
PROPERTIES OF WATERRead: Chapter 2 in Environmental Soil PhysicsStructure of the Water Molecule Water is a simple compound. The individual molecules of water contain one oxygen and two hydrogen atoms. The atoms are not arranged (bonded) linearly (
Wisconsin - MATH - 141
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 141
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
University of Texas - PSY - 333D
RESEARCH IN CHILD DEVELOPMENT *All Research entails: -Theory: an overarching set of assumptions &amp; explanations which helps to guide research e.g., Psychoanalytic theory; Theory of Natural Selection -Hypothesis: a testable predictionTwo-tailed: &quot;Brea
Wisconsin - MATH - 211
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)
Wisconsin - MATH - 211
Wisconsin - MATH - 211
NOTICE: This Material May Be Protected By Copyright Law (Title 17, U.S. Code)