ITEC1620 ObjectBased Programming - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

ITEC1620 ObjectBased Programming

Description:

Fall 2002 final exam question 2 // Part 1 draw the object diagrams at this time ... New finals. Build a static method that works on an array of objects ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 17
Provided by: atkinso
Category:

less

Transcript and Presenter's Notes

Title: ITEC1620 ObjectBased Programming


1
ITEC1620Object-Based Programming
  • Lecture 12b
  • Final Exam Review

2
Final Exam
  • 5 Questions, 100 marks total, 3 hours
  • 1 Building Classes (30 marks)
  • 2 References and Object Diagrams (15 marks)
  • 3 Structured Programming (15 marks)
  • 4 Arrays of Objects (15 marks)
  • 5 Object-Based Programming (25 marks)

3
Question 1
  • Building Classes
  • Given API
  • Determine fields of class
  • Implement a constructor
  • Implement a constructor with reuse
  • Implement one or two methods

4
Building Classes Example
  • Fall 2002 final exam question 1
  • DigitCode class
  • Fields

5
Building Classes Example II
  • public DigitCode (int first, int second)
  • public DigitCode ()

6
Building Classes Example III
  • public boolean changeCode (int old1, int old2,
    int new1, int new2)

7
Question 2
  • References and Object Diagrams
  • Two classes
  • Draw diagrams after declaration and construction
  • Draw diagrams after assignments
  • Note copying of primitive values and of references

8
References and Object Diagrams Example
  • Fall 2002 final exam question 2
  • // Part 1 draw the object diagrams at this time

9
References and Object Diagrams Example II
  • // Part 2 draw the object diagrams at this time

10
Question 3
  • Structured Progamming
  • Like question 5/6 on midterm except programming a
    method
  • Inputs come from parameters rather than Scanner
  • Outputs are returns rather than print

11
Structured Programming Example
  • Fall 2002 final exam question 5

12
Question 4
  • Arrays of Objects
  • Old finals
  • Build a static method that works on an array of
    ints
  • New finals
  • Build a static method that works on an array of
    objects

13
Arrays of Objects Example
  • Fall 2002 final exam question 3
  • Instead of ints, use AnInts
  • public class AnInt
  • public int getValue()

14
Arrays of Objects Example II
  • public static boolean moreOdd (AnInt ar)

15
Question 5
  • Object-Based Programming
  • Given 3 APIs
  • Implement two static methods that use instances
    of the 3 classes
  • Read APIs carefully to determine available
    functionality
  • Develop algorithm to achieve task

16
Review Options
  • Q1 Tutorial 7 sequence, old finals
  • Q2 Tutorial 8, old finals
  • Q3 old finals
  • Q4 Tutorial 11
  • Q5 old finals
Write a Comment
User Comments (0)
About PowerShow.com