Data structures intro
Data structures intro 12589.201580
Popular in CS II data structures
Gilson Dos Santos
verified elite notetaker
Popular in Computer Science and Engineering
This 3 page Class Notes was uploaded by Gilson Dos Santos on Tuesday October 20, 2015. The Class Notes belongs to 12589.201580 at Kent State University taught by Dr. Jonathan Maletic in Fall 2015. Since its upload, it has received 41 views. For similar materials see CS II data structures in Computer Science and Engineering at Kent State University.
Reviews for Data structures intro
What an unbelievable resource! I probably needed course on how to decipher my own handwriting, but not anymore...
-Shyanne Bechtelar II
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 10/20/15
ADT abstract data type Data Rules of usage opertations encapsulationstuff together class construct rules of usage embodied in operations information hiding helps creating rules of usage ADT Types pointxydata double xyrules of usage distprintreadinitset a valueoperations point hpp header only for the class declaration prototype ifndef CSZPOINTHPP dont have leading underscore the library might have one define CSZPOINTHPP so that the compiler only compiles the information once includeltiostreamgt class point public void initdoubledouble double getx double gety void setxdouble void setydouble point addpoint point subpoint double distpoint void printstdostreamamp private double xy endif file protection blank int main point abc ainit00 binit53 caaddb point is a class a is an object of typeclass point instance of a class person voe jane Golden rules of c 1always put include guards in hpp files 2always define a default constructorelse will get an error with array of points how things run lst preprocessor checks the hastag files and do what they saybefore compiling it 2nd template processor 3rd lex 4th parsins 5ht code gen 6ht linkins exe pointcpp include quotpointhppquot void pointinitdouble newxdouble newy the double colon means it can acess private data xnewxynewy double pointgetx return x point point addpoint rhs point result resultxxrhsxb resultyyrhsy return result void pointprintstdostream out coutltltllllltltxltltII IIltltyltltIIII main function include quotpointhppquot int main point abc ainit34 coutltltagetx Version two ifndef CSZPOINTHPP define CSZPOINTHPP INCLUDE ltIOSTREAMgt Class point Public pointdefault constructor pointdoubledouble for diferent types of initializing double setx double setxdouble point addpoint point operatorpoint so we can add two point with just the operator on the main function
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'