lec0131-ctors-ann - Today’s announcements: Course...

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

View Full Document Right Arrow Icon
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

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

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

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

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Today’s announcements: Course policies: httg://cs.illinoisedu/Class/CSZZS Email assistance (ews, svn): [email protected] Sections meet in Siebel 0224, NOT Siebel ARR. MP2 available, due 2/8, 11:59p. EC due 2/1. 11:59p. Proficiency exam: 1/31, 7-10p, Siebel 2407 0184141 13 32304? (a. SJ"! 6140‘) m; b; struct stu ( string :1; , 3MP mug: Parameter passmg summary: Puss 5‘3 VOL-4. bool pt: // prxnt (lag wast? waders ” P“, 5.3 we.th «In. c bool p51 (stuarl voxd p52 Istu 'If-In voxd ps3 [stu E :l!( E _ | _ ‘ ' ‘- c 1: 11:.pt) at (.a-.>pr| 1t I.a.pr) -9 C‘our ("3 a.n; oour -'.~:‘ 1:0: C‘our -'.'~'.' 3J1: g return true; u-3pt - true; a-pt - true.- LL } ) ) c s c )‘l g stu a: stu ° )3; m Btu c: “6 .- // nut a .. // nut ‘D K .. // 1n1t c Q a.pt - polka); pa2tb): 1333(2): g cout << a.pt: cout << b->7;;‘ * cout << c.pt: . C! “J on us huh « WW 'fi‘t 1" ocoul b 3|“) + . c,” .Iéd t M) OMG (f ~m~dunl tau?“ Bu 9" t (6“uA “W tr. T | 3? ° (C mft‘ 5 struct student I string name: . 8MP mug; Return values. M1 “med; ,, pm: mg int main“ 1 What happens when we student a: r) m” 00d. "k. ""35 boo]. b - Btlnt studentl (Mi D W1 print_utudent1 (student 3H 1! (la.szn1-_-d) cout << a.name << endl; struct student ( string name; 2MP mug: Returns: / bool planted: // pztnt {lag student ' print_utudent5(:tudent a)! atudent u - s:‘_——- w'l ‘4' z . u (iw.pzxnted)( . P f¢§tmgiiaAJf¢53 a: cout ("I w.nam{<< endl ' VGTRJ‘L k F ' w.pxxntcd - tr e: Function defn ’ rdwm P; retu tn 8w,- — ’ £ student c: student ' d: // 1n1t1alize c Example of use d - print ltud.nt5(C)l 1‘ "‘ ET ‘ 95 dd a. 5 1M F" “J :0 {3:}: A w wwk‘mtf) ottuct student I string name; BM? mug ; Returns' boo]. printed: // print flag H student‘: >uint_atudent5(st dent atu ent u - s:O-— it (tw.p:inte cout << w. Function defn } rctu rn H: — student c. d; _ .. // initialize c d - print_student5 (c) : Example of use Constructors reprise: y/default cons: ructo sphere::sphere(l: class sphere{ public: sphere(): sphero(doub10 r): sphere(conat sphere & orig): void setRadiustdouble newfind): doafiaf dQDE/czz “Jawmfa' 277: 0 Jeff Z‘o [cxaf’lcéfla au/fielv ykacz aQufflare if?’ sphere a; double getDiametet() conat: private: double thoRadius: int numAtta: string * attl: cd'or Copy constructor utility: - - 9%mymfiiphere 6 { p ay w; s return 3: class sphere{ public: aphete(): int main(){ sphere a, // initiali e a b: return 0; sphero(doub10 r): ‘a- ere(const sphere 8 ogig): void setRndius(doub1e newnad); double getDiameter() count: on private: int main(){ doublo thoRadius: int nunAtta: 39h». 51°03 string * outs: }: Ibis. a“ {w Copy CODSth‘OI': )vlcopy constructor sphere::sphere(const sphere l. orig) 1 class sphere{ public: whet-0 .- sphoro(doublo r): spheretconst sphere & orig): void setRadiua (double hound) : double qetDiamctcrO count: private: double thonadius: int numAtts: string ‘ ants: 1: ...
View Full Document

This note was uploaded on 01/26/2012 for the course CS CS 225 taught by Professor Heeren during the Spring '09 term at University of Illinois, Urbana Champaign.

Page1 / 9

lec0131-ctors-ann - Today’s announcements: Course...

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

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