Topic#4 - CS162 - Topic #4 Review of Classes Lecture:...

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

View Full Document Right Arrow Icon
CS162 - Topic #4 Review of Classes Lecture: Program Design Methodology Algorithms Structure Charts Programming Assignment Discussion What to turn in
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS162 - Review of Classes What is the difference between a class and a struct What is a data member? Where should a data member be placed in a class? (what section) What is a member function? Where should member functions be placed, if clients should use them?
Background image of page 2
CS162 - Review of Classes What is the difference between a member function and a regular-old C++ function? What is the purpose of the constructor? Why is it important to implement a constructor? What is the difference between a class and an object?
Background image of page 3

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

View Full DocumentRight Arrow Icon
CS162 - Review of Classes Show an example of how a client program defines an object of a list class How then would the client program call the constructor? (trick question!) How then would the client program call the display_all function? Why are paren’s needed?
Background image of page 4
CS162 - Review of Classes Write a simple class interface (called number ) that has the following members: an integer private data member (containing a value ) a constructor a set member function, that takes an integer as an arg and returns nothing a display member function
Background image of page 5

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

View Full DocumentRight Arrow Icon
CS162 - Review of Classes Now, let’s try our hand at implementing these functions a constructor a set member function, that takes an integer as an arg and returns nothing a display member function
Background image of page 6
CS162 - Review of Classes What happens if we forgot to put the keyword public in the previous class interface? Why is it necessary to place the class name, followed by the scope resolution operator ( :: ) when we implement a member function outside of a class?
Background image of page 7

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

View Full DocumentRight Arrow Icon
CS162 - Design Methods LECTURE
Background image of page 8
CS162 - Design Methods This week we will introduce some guidelines for designing algorithms, writing code, testing and debugging, verification, portability, efficiency, efficiency versus clarify, and software engineering.
Background image of page 9

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

View Full DocumentRight Arrow Icon
CS162 - Design Methods Programming is really all about solving problems. ..but we use a computer to do that for us! With small problems -- you may be able to get away
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 28

Topic#4 - CS162 - Topic #4 Review of Classes Lecture:...

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

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