Exam1Fall06key

Exam1Fall06key - 1 CSC216 Fall 2006 Exam 1 Key Student Name...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC216 Fall 2006 Exam 1 Key Student Name ____________________________________________________ This exam is closed book and closed notes. There are 105 points (5 points extra credit). Good luck! Part 1 Java Basics Circle the correct answer(s). (5 points) 1. Which of the following statements about variables in Java programs is true? Section 4: A,B, and C Section 5: A and C (5 points) 2. Section 4: for (int i = 0; i < 10;i++) { data[i] = i*i; } Section 5: for (int i = 0; i< 10; i++) { data[i] = (i+1) * (i+1); } (5 points) 3 .Provide the output for the following method. Section 4 **** **** **** Section 5 000000 111111 222222 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
(5 points) 4. Section 4 public int getMin ( ) { int min = a[0]; for (int i = 1; i< a.length ; i++) { if ( a[i] < min) min = a[i]; } return min; } Section 5 was getMax() so replace min with max and replace < with > Part 2 Design Concepts (same for sections 4 and 5) (4 points) 5. Below is a list of some of the methods in the String class. Identify each method as an accessor or a mutator. Simply put an A by any method that is an accessor and M by any method that is a mutator : All are accessors (5 points) 6. Is this set of methods cohesive ? ___yes__ Why or why not? Single concept (5 points) 7.Explain what coupling is and discuss coupling for project 1. The classes were the PointOfSaleGUI, ListOfItems , StoreItem and LogFile. Read the book for a discussion of coupling…
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

Exam1Fall06key - 1 CSC216 Fall 2006 Exam 1 Key Student Name...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online