In this module we bridge some of the Object-Oriented ideas and Java constructs to C++. We cover the basics on how to build, link, and run C++ code, as well as show how C++ constructs interact with the memory model we developed during the semester for Java.

We then cover some of the correspondence between Java and C++ constructs through a series of examples. We conclude this module with an introduction to pointers and memory management in C++.

  1. Given a set of C++ source files, compile and run the program.
  2. Given an UML class diagram, translate the corresponding C++ classes.
  3. Given a C++ class and an operator, write the member function that overloads the operator.
  4. Given a structure definition in C++, implement a function that operates on a struct.
  5. Given a union definition in C++, implement a function that operates on a union.
  6. Given C++ code that uses pointers, draw a diagram to showing memory state on the stack and heap.
  7. Write a C++ program that calls a member function that uses pass by reference arguments.
  8. Explain what a destructor member function does in C++.
  9. Explain what a copy constructor member function does in C++.
  10. Given an operator, contrast operator overloading in C++ with method overloading in Java.

  • DUE DATE: TBD

SUMMARY OF ASSIGNMENT

Problem Points
Problem 1 3
Problem 2 25
Problem 3 9
Problem 4 5
GRAND TOTAL: 42

Problem 1

Item Points
Math formula written in comments or Racket 1
Correct answers for numbers 10 and 15 2
TOTAL POSSIBLE POINTS 3

Problem 2

Item Points
Math formula written in comments or Racket 2
Correct answers 1
Correct values inside the table 6
Correct values for updated table 7
Math formula written in comments or Racket 2
Math formula written in comments or Racket 3
Correct values for 30, 60, 90 and 120 days 1
TOTAL POSSIBLE POINTS 25

Problem 3

Item Points
Correct answer for 2, 5, and 10 hours of work 3
Math formula written in comments or Racket 3
Correct answers for 100, 132, and 141 hours 3
TOTAL POSSIBLE POINTS 9

Problem 4

Item Points
Racket function 2
Correct answer for each conversion 3
TOTAL POSSIBLE POINTS 5