ÓÑÇéÌáʾ£ºÈç¹û±¾ÍøÒ³´ò¿ªÌ«Âý»òÏÔʾ²»ÍêÕû£¬Çë³¢ÊÔÊó±êÓÒ¼ü¡°Ë¢Ð¡±±¾ÍøÒ³£¡
¸»Ê¿¿µÐ¡ËµÍø ·µ»Ø±¾ÊéĿ¼ ¼ÓÈëÊéÇ© ÎÒµÄÊé¼Ü ÎÒµÄÊéÇ© TXTÈ«±¾ÏÂÔØ ¡ºÊղص½ÎÒµÄä¯ÀÀÆ÷¡»

VB2008´ÓÈëÃŵ½¾«Í¨(PDF¸ñʽӢÎÄ°æ)-µÚ8²¿·Ö

¿ì½Ý²Ù×÷: °´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³ °´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ °´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿! Èç¹û±¾ÊéûÓÐÔĶÁÍ꣬ÏëÏ´μÌÐø½Ó×ÅÔĶÁ£¬¿ÉʹÓÃÉÏ·½ "Êղص½ÎÒµÄä¯ÀÀÆ÷" ¹¦ÄÜ ºÍ "¼ÓÈëÊéÇ©" ¹¦ÄÜ£¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Macintosh¡¡OS¡¡X¡¡or¡¡Linux¡¡puter£»¡¡will¡¡the¡¡application¡¡run£¿¡¡Why¡¡will¡¡it¡¡run¡¡or¡¡not¡¡run£¿¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡45¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡C¡¡H¡¡AP¡¡TE¡¡R¡¡¡¡¡¡1¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡R¡¡E¡¡AD¡¡Y¡¡£»¡¡¡¡¡¡ST¡¡E¡¡AD¡¡Y¡¡£»¡¡¡¡¡¡G¡¡O£¡¡¡23¡¡



5¡£¡¡¡¡You¡¡are¡¡not¡¡happy¡¡with¡¡the¡¡naming¡¡of¡¡the¡¡element¡¡TextBox1£»¡¡and¡¡want¡¡to¡¡rename¡¡it¡¡to¡¡¡¡

¡¡¡¡¡¡¡¡TxtOutput¡£¡¡How¡¡do¡¡you¡¡go¡¡about¡¡renaming¡¡TextBox1£¿¡¡



6¡£¡¡¡¡ClassLibrary¡¡has¡¡embedded¡¡logic¡¡that¡¡assumes¡¡the¡¡caller¡¡of¡¡the¡¡method¡¡is¡¡a¡¡console¡¡¡¡

¡¡¡¡¡¡¡¡application¡£¡¡Is¡¡it¡¡good¡¡to¡¡assume¡¡a¡¡specific¡¡application¡¡type¡¡or¡¡logic¡¡of¡¡the¡¡caller¡¡in¡¡a¡¡¡¡

¡¡¡¡¡¡¡¡library£¿¡¡If¡¡yes£»¡¡why£¿¡¡If¡¡no£»¡¡why¡¡not£¿¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡46¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡47¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

C¡¡¡¡H¡¡¡¡A¡¡¡¡P¡¡¡¡T¡¡¡¡E¡¡¡¡R¡¡¡¡¡¡¡¡¡¡2¡¡



¡ö¡¡¡ö¡¡¡ö¡¡



Learning¡¡About¡¡¡¡Number¡¡¡¡

and¡¡Value¡¡Types¡¡¡¡



In¡¡the¡¡previous¡¡chapter£»¡¡you¡¡learned¡¡how¡¡to¡¡use¡¡Visual¡¡Basic¡¡Express£»¡¡and¡¡what¡¡¡¡is¡¡in¡¡terms¡¡of¡¡¡¡

the¡¡CIL¡¡and¡¡CLR¡£¡¡In¡¡this¡¡chapter£»¡¡we¡¡are¡¡going¡¡to¡¡roll¡¡up¡¡our¡¡sleeves¡¡and¡¡begin¡¡writing¡¡real¡¡¡¡

Visual¡¡Basic¡¡code¡ªspecifically£»¡¡a¡¡calculator¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡A¡¡calculator¡¡is¡¡an¡¡ideal¡¡example¡¡to¡¡start¡¡with£»¡¡because¡¡it¡¡allows¡¡you¡¡to¡¡focus¡¡on¡¡the¡¡applica

tion¡¡without¡¡having¡¡to¡¡deal¡¡with¡¡all¡¡the¡¡nasty¡¡details¡¡that¡¡are¡¡normally¡¡associated¡¡with¡¡programs¡£¡¡¡¡

In¡¡a¡¡programming¡¡language¡¡like¡¡Visual¡¡Basic£»¡¡adding¡¡two¡¡numbers¡¡is¡¡trivial¡£¡¡What¡¡is¡¡not¡¡trivial¡¡¡¡

is¡¡how¡¡to¡¡put¡¡the¡¡operation¡¡of¡¡adding¡¡two¡¡numbers¡¡into¡¡a¡¡program¡£¡¡

¡¡¡¡¡¡¡¡¡¡This¡¡chapter¡¡focuses¡¡on¡¡the¡¡mechanics¡¡of¡¡writing¡¡a¡¡program¡¡in¡¡Visual¡¡Basic¡ªtaking¡¡an¡¡¡¡

idea¡¡and¡¡converting¡¡it¡¡into¡¡a¡¡Visual¡¡Basic¡¡program¡¡that¡¡can¡¡execute¡¡your¡¡intentions¡£¡¡You¡¯ll¡¡learn¡¡¡¡

how¡¡to¡¡organize¡¡your¡¡development¡¡and¡¡implement¡¡a¡¡Visual¡¡Basic¡¡class¡¡library£»¡¡as¡¡well¡¡as¡¡how¡¡¡¡

the¡¡¡¡CLR¡¡manages¡¡number¡¡types¡£¡¡



Focusing¡¡and¡¡Organizing¡¡Your¡¡Development¡¡



When¡¡you¡¡develop¡¡software£»¡¡you¡¡will¡¡split¡¡your¡¡work¡¡into¡¡two¡¡main¡¡tasks£º¡¡organizing¡¡and¡¡imple

menting¡£¡¡Organizing¡¡your¡¡development¡¡involves¡¡figuring¡¡out¡¡what¡¡features¡¡and¡¡libraries¡¡you¡¡¡¡

are¡¡going¡¡to¡¡define£»¡¡how¡¡many¡¡people¡¡are¡¡going¡¡to¡¡be¡¡developing¡¡the¡¡features£»¡¡and¡¡so¡¡on¡£¡¡

¡¡¡¡¡¡¡¡¡¡Organizing¡¡your¡¡development¡¡is¡¡one¡¡of¡¡the¡¡most¡¡important¡¡tasks¡¡when¡¡writing¡¡code£»¡¡and¡¡¡¡

it¡¡is¡¡also¡¡typically¡¡the¡¡most¡¡confusing¡¡for¡¡new¡¡developers¡£¡¡Professional¡¡developers¡¡seem¡¡to¡¡¡¡

organize¡¡their¡¡work¡¡instinctively£»¡¡but¡¡it¡¡only¡¡appears¡¡that¡¡way¡¡because¡¡they¡¡have¡¡done¡¡it¡¡so¡¡¡¡

many¡¡times¡¡that¡¡the¡¡process¡¡has¡¡bee¡¡automatic¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡When¡¡developers¡¡are¡¡tasked¡¡with¡¡creating¡¡a¡¡program£»¡¡they¡¡are¡¡asked¡¡to¡¡write¡¡software¡¡that¡¡¡¡

implements¡¡a¡¡set¡¡of¡¡features¡£¡¡Features¡¡could¡¡include¡¡calculating¡¡daily¡¡interest¡¡payments£»¡¡auto

matically¡¡generating¡¡letters¡¡indicating¡¡the¡¡acceptance¡¡or¡¡rejection¡¡of¡¡a¡¡loan£»¡¡and¡¡so¡¡on¡£¡¡A¡¡feature¡¡¡¡

always¡¡relates¡¡to¡¡performing¡¡some¡¡task¡¡that¡¡is¡¡determined¡¡by¡¡some¡¡process¡£¡¡You¡¡could¡¡say¡¡that¡¡¡¡

feature¡¡implementation¡¡is¡¡the¡¡direct¡¡implementation¡¡of¡¡a¡¡task¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡25¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡48¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

26¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡AP¡¡T¡¡E¡¡R¡¡¡¡¡¡2¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡L¡¡E¡¡A¡¡R¡¡N¡¡IN¡¡G¡¡¡¡¡¡AB¡¡OU¡¡T¡¡¡¡¡¡¡£¡¡N¡¡E¡¡T¡¡¡¡N¡¡U¡¡M¡¡B¡¡E¡¡R¡¡¡¡¡¡A¡¡N¡¡D¡¡¡¡¡¡V¡¡A¡¡L¡¡U¡¡E¡¡¡¡¡¡T¡¡Y¡¡P¡¡E¡¡S¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡When¡¡defining¡¡the¡¡features£»¡¡two¡¡major¡¡steps¡¡are¡¡involved£º¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡Gain¡¡an¡¡understanding¡¡of¡¡the¡¡features¡£¡¡You¡¡can¡¯t¡¡implement¡¡something¡¡that¡¡you¡¡don¡¯t¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡understand¡£¡¡To¡¡be¡¡able¡¡to¡¡write¡¡the¡¡source¡¡code¡¡for¡¡a¡¡feature£»¡¡you¡¡need¡¡to¡¡know¡¡the¡¡whys¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡and¡¡whats¡¡of¡¡a¡¡feature¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡Describe¡¡the¡¡features¡¡using¡¡structured¡¡design¡¡methods¡£¡¡Simply¡¡organizing¡¡your¡¡thoughts¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡may¡¡be¡¡enough¡¡if¡¡you¡¡are¡¡the¡¡only¡¡person¡¡working¡¡on¡¡a¡¡program£»¡¡however£»¡¡more¡¡often¡¡than¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡not£»¡¡you¡¡will¡¡be¡¡part¡¡of¡¡a¡¡team¡£¡¡You¡¡need¡¡to¡¡use¡¡a¡¡structured¡¡design¡¡method¡¡so¡¡that¡¡you¡¡and¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡your¡¡team¡¡members¡¡can¡¡municate¡¡the¡¡thoughts¡¡related¡¡to¡¡program¡¡development¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡One¡¡mon¡¡structured¡¡design¡¡method¡¡is¡¡the¡¡Unified¡¡Modeling¡¡Language¡¡£¨UML£©¡£¡¡UML¡¡is¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡used¡¡to¡¡organize¡¡the¡¡features¡¡into¡¡units¡¡that¡¡correspond¡¡to¡¡programming¡¡language¡¡constructs£»¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡such¡¡as¡¡classes¡£¡¡Think¡¡of¡¡UML¡¡as¡¡software¡¡developer¡­specific¡¡lingo¡¡used¡¡to¡¡describe¡¡the¡¡various¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡aspects¡¡of¡¡a¡¡programming¡¡environment¡¡at¡¡a¡¡higher¡¡level¡¡of¡¡abstraction¡£¡¡UML¡¡allows¡¡you¡¡to¡¡get¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡an¡¡overall¡¡understanding¡¡of¡¡the¡¡architecture¡¡without¡¡having¡¡to¡¡read¡¡the¡¡source¡¡code¡£¡¡Think¡¡of¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡UML¡¡as¡¡the¡¡structured¡¡doodle¡¡on¡¡the¡¡napkin¡¡of¡¡software¡¡programming¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Along¡¡with¡¡UML£»¡¡there¡¡are¡¡other¡¡ways¡¡of¡¡structuring¡¡your¡¡development¡¡process¡£¡¡For¡¡example£»¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡another¡¡technique¡¡is¡¡called¡¡agile¡¡software¡¡development¡£¡¡The¡¡idea¡¡with¡¡agile¡¡software¡¡develop

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ment¡¡is¡¡to¡¡use¡¡a¡¡whiteboard¡¡and¡¡develop¡¡your¡¡own¡¡structured¡¡munication¡¡mechanism¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡The¡¡choice¡¡of¡¡UML£»¡¡agile¡¡software¡¡development£»¡¡or¡¡another¡¡structured¡¡design¡¡method¡¡is¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡up¡¡to¡¡you¡¡and¡¡your¡¡team¡¡members¡£¡¡But¡¡you¡¡will¡¡need¡¡to¡¡organize¡¡your¡¡thoughts¡¡and¡¡have¡¡a¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡structured¡¡munication¡¡technique¡£¡¡If¡¡you¡¡don¡¯t£»¡¡your¡¡software¡¡will¡¡be¡¡late£»¡¡buggy£»¡¡too¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡expensive£»¡¡or¡¡inplete¡£¡¡It¡¡is¡¡not¡¡an¡¡understatement¡¡to¡¡say¡¡that¡¡organization¡¡is¡¡half¡¡the¡¡battle¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡In¡¡this¡¡chapter£»¡¡I¡¡am¡¡going¡¡to¡¡give¡¡you¡¡a¡¡taste¡¡of¡¡a¡¡simplified¡¡structured¡¡development¡¡tech

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡nique£»¡¡so¡¡that¡¡you¡¡at¡¡least¡¡have¡¡an¡¡idea¡¡of¡¡how¡¡structured¡¡development¡¡works¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Organizing¡¡the¡¡Calculator¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡To¡¡begin¡¡this¡¡chapter¡¯s¡¡example£»¡¡get¡¡a¡¡piece¡¡of¡¡paper¡¡and¡¡a¡¡pen¡¡or¡¡pencil£»¡¡or¡¡you¡¡can¡¡use¡¡a¡¡tablet¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡PC¡¡for¡¡writing£»¡¡if¡¡you¡¡have¡¡one¡£¡¡Next£»¡¡in¡¡the¡¡center¡¡of¡¡the¡¡paper¡¡£¨or¡¡virtual¡¡paper£©£»¡¡draw¡¡a¡¡circle¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡and¡¡in¡¡it¡¡write¡¡the¡¡word¡¡¡¡Calculator¡£¡¡Now¡¡stop¡¡and¡¡think¡¡about¡¡what¡¡a¡¡calculator¡¡means¡¡with¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡respect¡¡to¡¡the¡¡software¡¡that¡¡you¡¡will¡¡be¡¡writing¡£¡¡Write¡¡those¡¡ideas¡¡on¡¡the¡¡paper¡¡surrounding¡¡the¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡circle¡£¡¡My¡¡thoughts¡¡are¡¡shown¡¡in¡¡Figure¡¡2¡­1¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Your¡¡thoughts¡¡and¡¡my¡¡thoughts¡¡may¡¡or¡¡may¡¡not¡¡be¡¡the¡¡same£»¡¡but¡¡what¡¡our¡¡results¡¡will¡¡have¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡in¡¡mon¡¡is¡¡a¡¡hodgepodge¡¡of¡¡ideas¡¡everywhere¡£¡¡Figure¡¡2¡­1¡¡illustrates¡¡that¡¡one¡¡of¡¡the¡¡biggest¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡problems¡¡software¡¡developers¡¡face¡¡is¡¡lack¡¡of¡¡focus¡¡and¡¡organization¡£¡¡It¡¡is¡¡not¡¡that¡¡developers¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡can¡¯t¡¡focus¡¡or¡¡organize£»¡¡but¡¡that¡¡developers¡¡are¡¡bombarded¡¡by¡¡information£»¡¡and¡¡it¡¡is¡¡a¡¡Herculean¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡task¡¡to¡¡keep¡¡track¡¡of£»¡¡let¡¡alone¡¡organize£»¡¡all¡¡of¡¡that¡¡information¡£¡¡But¡¡software¡¡projects¡¡that¡¡are¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡successful¡¡must¡¡remain¡¡focused¡¡and¡¡organized¡£¡¡Therefore£»¡¡the¡¡next¡¡step¡¡is¡¡to¡¡focus¡¡and¡¡organize¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡your¡¡thoughts£»¡¡which¡¡results¡¡in¡¡something¡¡like¡¡Figure¡¡2¡­2¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡In¡¡Figure¡¡2¡­2£»¡¡the¡¡ideas¡¡are¡¡organized¡¡by¡¡classification¡£¡¡As¡¡this¡¡is¡¡book¡¡is¡¡about¡¡a¡¡program

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ming¡¡language£»¡¡the¡¡only¡¡relevant¡¡ideas¡¡are¡¡those¡¡related¡¡to¡¡source¡¡code¡¡functionality¡£¡¡Roughly¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡speaking£»¡¡in¡¡the¡¡source¡¡code¡¡category£»¡¡each¡¡thought¡¡corresponds¡¡to¡¡a¡¡feature¡¡to¡¡implement¡£¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡49¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡A¡¡PT¡¡E¡¡R¡¡¡¡¡¡2¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡L¡¡E¡¡A¡¡R¡¡N¡¡I¡¡N¡¡G¡¡¡¡¡¡A¡¡B¡¡OU¡¡T¡¡¡¡¡¡¡£¡¡N¡¡E¡¡T¡¡¡¡N¡¡U¡¡M¡¡B¡¡E¡¡R¡¡¡¡¡¡AN¡¡D¡¡¡¡¡¡V¡¡A¡¡L¡¡U¡¡E¡¡¡¡¡¡T¡¡Y¡¡P¡¡E¡¡S¡¡¡¡27¡¡



Figure¡¡2¡­1¡£¡¡Brainstorming¡¡what¡¡the¡¡calculator¡¡application¡¡represents¡¡



Figure¡¡2¡­2¡£¡¡Focused¡¡and¡¡organized¡¡brainstorming¡¡



Focusing¡¡the¡¡Calculator¡¡



To¡¡implement¡¡a¡¡feature£»¡¡you¡¡need¡¡source¡¡code£»¡¡which¡¡means¡¡a¡¡file£»¡¡project£»¡¡and¡¡other¡¡program

ming¡¡techniques¡£¡¡The¡¡following¡¡two¡¡levels¡¡of¡¡organization¡¡are¡¡defined¡¡in¡¡Visual¡¡Basic£º¡¡



¡¡¡¡¡¡¡¡¡¡o¡¡¡¡File¡¡level£º¡¡At¡¡the¡¡file¡¡level£»¡¡you¡¡are¡¡organizing¡¡what¡¡kinds¡¡of¡¡projects¡¡and¡¡solutions¡¡you¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡will¡¡be¡¡creating¡£¡¡



¡¡¡¡¡¡¡¡¡¡o¡¡¡¡Source¡¡code¡¡level£º¡¡At¡¡the¡¡source¡¡code¡¡level£»¡¡you¡¡are¡¡organizing¡¡the¡¡namespaces£»¡¡modules£»¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡class¡¡names£»¡¡and¡¡other¡¡identifiers¡¡that¡¡are¡¡referenced¡¡throughout¡¡the¡¡source¡¡code¡£¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡50¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

28¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡AP¡¡T¡¡E¡¡R¡¡¡¡¡¡2¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡L¡¡E¡¡A¡¡R¡¡N¡¡IN¡¡G¡¡¡¡¡¡AB¡¡OU¡¡T¡¡¡¡¡¡¡£¡¡N¡¡E¡¡T¡¡¡¡N¡¡U¡¡M¡¡B¡¡E¡¡R¡¡¡¡¡¡A¡¡N¡¡D¡¡¡¡¡¡V¡¡A¡¡L¡¡U¡¡E¡¡¡¡¡¡T¡¡Y¡¡P¡¡E¡¡S¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡For¡¡the¡¡most¡¡part£»¡¡Visual¡¡Basic¡¡developers¡¡do¡¡not¡¡concern¡¡themselves¡¡too¡¡much¡¡with¡¡the¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡file¡¡organization¡£¡¡A¡¡mon¡¡practice¡¡is¡¡to¡¡consider¡¡a¡¡class¡¡or¡¡module¡¡as¡¡a¡¡single¡¡file¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡When¡¡implementing¡¡an¡¡application£»¡¡you¡¡will¡¡begin¡¡by¡¡deciding¡¡whether¡¡you¡¡will¡¡use¡¡a¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡console¡¡application£»¡¡a¡¡Windows¡¡application£»¡¡or¡¡a¡¡class¡¡library¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡If¡¡the¡¡calculator¡¡were¡¡a¡¡Windows¡¡application£»¡¡it¡¡could¡¡look¡¡like¡¡Figure¡¡2¡­3¡£¡¡A¡¡calculator¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡implemented¡¡as¡¡a¡¡Windows¡¡application¡¡allows¡¡users¡¡to¡¡perform¡¡calculations¡¡by¡¡clicking¡¡the¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡appropriate¡¡buttons¡£¡¡For¡¡example£»¡¡to¡¡add¡¡two¡¡numbers£»¡¡the¡¡user¡¡clicks¡¡the¡¡appropriate¡¡buttons¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡to¡¡key¡¡in¡¡the¡¡first¡¡number£»¡¡then¡¡an¡¡operation£»¡¡then¡¡the¡¡second¡¡number£»¡¡and¡¡finally£»¡¡the¡¡equal¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡sign¡¡to¡¡perform¡¡the¡¡calculation¡£¡¡The¡¡equal¡¡sign¡¡is¡¡a¡¡signal¡¡to¡¡the¡¡calculator¡¡application¡¡to¡¡process¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡the¡¡data¡¡that¡¡has¡¡been¡¡entered¡¡and¡¡generate¡¡a¡¡result¡£¡¡The¡¡text¡¡box¡¡would¡¡display¡¡the¡¡results¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Figure¡¡2¡­3¡£¡¡A¡¡calculator¡¡implemented¡¡as¡¡a¡¡Windows¡¡application¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡The¡¡second¡¡choice¡¡is¡¡to¡¡implement¡¡a¡¡calculator¡¡using¡¡a¡¡console¡¡application£»¡¡where¡¡the¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡numbers¡¡are¡¡entered¡¡as¡¡text£»¡¡as¡¡illustrated¡¡in¡¡Figure¡¡2¡­4¡£¡¡The¡¡calculator¡¡does¡¡not¡¡expect¡¡users¡¡to¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡click¡¡buttons£»¡¡rather£»¡¡they¡¡press¡¡the¡¡appropriate¡¡keyboard¡¡keys¡¡to¡¡enter¡¡the¡¡appropriate¡¡number¡¡at¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡the¡¡appropriate¡¡time¡¡with¡¡the¡¡appropriate¡¡operation¡£¡¡Typically£»¡¡an¡¡Enter¡¡key¡¡will¡¡serve¡¡as¡¡an¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡equal¡¡sign¡¡button¡¡and¡¡perform¡¡a¡¡calculation£»¡¡which¡¡is¡¡output¡¡to¡¡the¡¡console¡£¡¡Once¡¡one¡¡calcula

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡tion¡¡has¡¡pleted£»¡¡the¡¡cycle¡¡starts¡¡again¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡If¡¡you¡¡had¡¡to¡¡choose¡¡between¡¡a¡¡Windows¡¡or¡¡console¡¡application¡¡for¡¡the¡¡calculator£»¡¡you¡¡would¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡choose¡¡the¡¡Windows¡¡application¡¡because¡¡it¡¡looks¡¡better¡¡and¡¡is¡¡easier¡¡to¡¡use¡£¡¡In¡¡the¡¡focused¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡thoughts¡¡of¡¡Figure¡¡2¡­2£»¡¡ease¡¡of¡¡use¡¡was¡¡not¡¡defined¡¡as¡¡a¡¡feature¡£¡¡Should¡¡the¡¡user¡¡interface¡¡type¡¡have¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡been¡¡a¡¡feature£¿¡¡Normally£»¡¡yes¡¡it¡¡should¡¡be¡¡a¡¡feature£»¡¡but¡¡for¡¡the¡¡scope¡¡of¡¡this¡¡chapter£»¡¡it¡¡is¡¡not¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡The¡¡user¡¡interaction¡¡between¡¡the¡¡two¡¡types¡¡of¡¡applications¡¡is¡¡dramatically¡¡different£»¡¡and¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡implies¡¡two¡¡different¡¡programs£»¡¡even¡¡though¡¡they¡¡implement¡¡the¡¡same¡¡features¡£¡¡The¡¡focus¡¡is¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡not¡¡on¡¡creating¡¡a¡¡particular¡¡program¡¡type£»¡¡but¡¡on¡¡the¡¡overall¡¡programming¡¡structure¡£¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡51¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡A¡¡PT¡¡E¡¡R¡¡¡¡¡¡2¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡L¡¡E¡¡A¡¡R¡¡N¡¡I¡¡N¡¡G¡¡¡¡¡¡A¡¡B¡¡OU¡¡T¡¡¡¡¡¡¡£¡¡N¡¡E¡¡T¡¡¡¡N¡¡U¡¡M¡¡B¡¡E¡¡R¡¡¡¡¡¡AN¡¡D¡¡¡¡¡¡V¡¡A¡¡L¡¡U¡¡E¡¡¡¡¡¡T¡¡Y¡¡P¡¡E¡¡S¡¡¡¡29¡¡



Figure¡¡2¡­4¡£¡¡A¡¡calculator¡¡implemented¡¡as¡¡a¡¡console¡¡application¡¡



¡¡¡¡¡¡¡¡¡¡¡¡Let¡¯s¡¡step¡¡back¡¡and¡¡think¡¡about¡¡this¡¡abstractly¡£¡¡You¡¡are¡¡a¡¡programmer¡¡and¡¡have¡¡been¡¡¡¡

charged¡¡with¡¡the¡¡task¡¡of¡¡implementing¡¡the¡¡calculator¡¡for¡¡both¡¡user¡¡interfaces¡£¡¡Again£»¡¡thinking¡¡¡¡

abstractly£»¡¡would¡¡you¡¡implement¡¡all¡¡the¡¡functionality¡¡twice£»¡¡or¡¡would¡¡you¡¡try¡¡to¡¡think¡¡about¡¡¡¡

which¡¡parts¡¡of¡¡the¡¡calculator¡¡could¡¡be¡¡reused¡¡for¡¡both¡¡user¡¡interfaces£¿¡¡Most¡¡likely£»¡¡your¡¡answer¡¡¡¡

will¡¡be¡¡that¡¡you¡¡want¡¡to¡¡reuse¡¡parts¡¡of¡¡the¡¡calculator¡¡so¡¡that¡¡you¡¡have¡¡less¡¡work¡£¡¡But¡¡you¡¡also¡¡want¡¡¡¡

to¡¡reuse¡¡parts¡¡so¡¡that¡¡you¡¡can¡¡avoid¡¡additional¡¡maintenance¡¡and¡¡program¡¡extension¡¡problems¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡So£»¡¡for¡¡software¡¡development£»¡¡you¡¡need¡¡to¡¡think¡¡of¡¡the¡¡software¡¡as¡¡pieces¡¡that¡¡are¡¡assem

bled¡¡into¡¡a¡¡program¡£¡¡Some¡¡pieces¡¡can¡¡be¡¡reused£»¡¡and¡¡other¡¡pieces¡¡cannot¡¡be¡¡reused¡£¡¡Therefore£»¡¡¡¡

think¡¡of¡¡the¡¡calculator¡¡application¡¡as¡¡two¡¡pieces£º¡¡the¡¡user¡¡interface¡¡and¡¡the¡¡piece¡¡that¡¡performs¡¡¡¡

calculations¡¡based¡¡on¡¡data¡¡delivered¡¡by¡¡the¡¡user¡¡interface¡£¡¡From¡¡an¡¡organizational¡¡perspective£»¡¡¡¡

or¡¡in¡¡developer¡¡lingo£»¡¡from¡¡an¡¡architectural¡¡perspective£»¡¡the¡¡calculator¡¡pieces¡¡would¡¡be¡¡arranged¡¡as¡¡¡¡

shown¡¡in¡¡Figure¡¡2¡­5¡£¡¡

¡¡¡¡¡¡¡¡¡¡¡¡The¡¡individual¡¡pieces¡¡in¡¡Figure¡¡2¡­5¡¡are¡¡called¡¡¡¡ponents¡£¡¡£¨Some¡¡individuals¡¡might¡¡even¡¡¡¡

call¡¡the¡¡pieces¡¡modules£»¡¡but¡¡I¡¡personally¡¡prefer¡¡the¡¡term¡¡ponents£»¡¡and¡¡in¡¡a¡¡Visual¡¡Basic¡¡¡¡

book£»¡¡calling¡¡them¡¡modules¡¡could¡¡lead¡¡to¡¡confusion£©¡£¡¡The¡¡ponents¡¡are¡¡arranged¡¡from¡¡the¡¡¡¡

lower¡­level¡¡functionality¡¡at¡¡the¡¡bottom¡¡of¡¡the¡¡picture¡¡to¡¡the¡¡higher¡­level¡¡functionality¡¡near¡¡the¡¡¡¡

top¡¡of¡¡the¡¡picture¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡Each¡¡ponent¡¡fulfills¡¡a¡¡particular¡¡task£»¡¡and¡¡the¡¡higher¡­level¡¡ponents¡¡use¡¡those¡¡tasks¡¡¡¡

implemented¡¡at¡¡a¡¡lower¡¡level¡£¡¡The¡¡idea¡¡is¡¡that¡¡each¡¡level¡¡is¡¡responsible¡¡for¡¡certain¡¡functionality£»¡¡¡¡

and¡¡other¡¡levels¡¡do¡¡not¡¡duplicate¡¡efforts¡¡by¡¡reimplementing¡¡certain¡¡functionality¡£¡¡The¡¡higher

level¡¡functionality¡¡does¡¡have¡¡a¡¡lower¡­level¡¡dependency£»¡¡but¡¡the¡¡lower¡¡level¡¡does¡¡not¡¡have¡¡a¡¡¡¡

higher¡­level¡¡dependency¡£¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡52¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

30¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡AP¡¡T¡¡E¡¡R¡¡¡¡¡¡2¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡L¡¡E¡¡A¡¡R¡¡N¡¡IN¡¡G¡¡¡¡¡¡AB¡¡OU¡¡T¡¡¡¡¡¡¡£¡¡N¡¡E¡¡T¡¡¡¡N¡¡U¡¡M¡¡B¡¡E¡¡R¡¡¡¡¡¡A¡¡N¡¡D¡¡¡¡¡¡V¡¡A¡¡L¡¡U¡¡E¡¡¡¡¡¡T¡¡Y¡¡P¡¡E¡¡S¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Figure¡¡2¡­5¡£¡¡Arrangement¡¡of¡¡calculator¡¡pieces¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Applications¡¡are¡¡realized¡¡using¡¡either¡¡top¡­down¡¡or¡¡bottom¡­up¡¡architecture¡£¡¡A¡¡top¡­down¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡methodology¡¡means¡¡creating¡¡the¡¡higher¡­level¡¡ponents¡¡and¡¡then¡¡implementing¡¡the¡¡lower

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡level¡¡ponents¡¡when¡¡needed¡£¡¡In¡¡contrast£»¡¡a¡¡bottom¡­up¡¡methodology¡¡means¡¡creating¡¡the¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡bottom¡¡ponents¡¡first¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡A¡¡bottom¡­up¡¡approach¡¡is¡¡useful¡¡when¡¡you¡¡know¡¡clearly¡¡which¡¡features¡¡need¡¡to¡¡be¡¡imple

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mented¡£¡¡A¡¡top¡­down¡¡approach¡¡is¡¡better¡¡when¡¡you¡¡have¡¡a¡¡rough¡¡idea¡¡of¡¡what¡¡features¡¡need¡¡to¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡be¡¡implemented£»¡¡but¡¡don¡¯t¡¡want¡¡to¡¡stray¡¡too¡¡far¡¡from¡¡the¡¡goal¡¡of¡¡the¡¡application¡£¡¡The¡¡focus¡¡of¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡this¡¡chapter¡¡is¡¡to¡¡develop¡¡the¡¡Calculator¡¡class¡¡library£»¡¡shown¡¡at¡¡the¡¡bottom¡¡of¡¡Figure¡¡2¡­5£»¡¡so¡¡we¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡will¡¡take¡¡the¡¡bottom¡­up¡¡approach¡¡in¡¡this¡¡chapter¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Implementing¡¡the¡¡Class¡¡Library¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡The¡¡creation¡¡of¡¡a¡¡class¡¡library¡¡is¡¡a¡¡form¡¡of¡¡file¡¡organization¡£¡¡The¡¡next¡¡step¡¡is¡¡to¡¡create¡¡some¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡source¡¡code¡¡for¡¡the¡¡class¡¡library¡£¡¡The¡¡source¡¡code¡¡is¡¡implemented¡¡in¡¡two¡¡steps£º¡¡¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡Define¡¡the¡¡class¡¡and¡¡methods¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡o¡¡¡¡Implement¡¡the¡¡methods¡£¡¡



¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡One¡¡of¡¡the¡¡biggest¡¡problems¡¡when¡¡learning¡¡a¡¡new¡¡language¡¡is¡¡understanding¡¡what¡¡the¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡language¡¡can¡¡and¡¡cannot¡¡do¡£¡¡You¡¡can¡¯t¡¡write¡¡source¡¡code¡¡that¡¡the¡¡language¡¡does¡¡not¡¡under

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡stand¡£¡¡So¡¡it¡¡is¡¡extremely¡¡important¡¡to¡¡know¡¡the¡¡programming¡¡language£»¡¡because¡¡it¡¡determines¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡how¡¡your¡¡thoughts¡¡will¡¡be¡¡structured¡£¡¡¡¡


¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­Page¡¡53¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CH¡¡A¡¡PT¡¡E¡¡R¡¡¡¡¡¡2¡¡¡¡¡¡¡ö¡¡¡¡¡¡¡¡L¡¡E¡¡A¡¡R¡¡N¡¡I¡¡N¡¡G¡¡¡¡¡¡A¡¡B¡¡OU¡¡T¡¡¡¡¡¡¡£¡¡N¡¡E¡¡T¡¡¡¡N¡¡U¡¡M¡¡B¡¡E¡¡R¡¡¡¡¡¡AN¡¡D¡¡¡¡¡¡V¡¡A¡¡L¡¡U¡¡E¡¡¡¡¡¡T¡¡Y¡¡P¡¡E¡¡S¡¡¡¡31¡¡



¡¡¡¡¡¡¡¡¡¡You¡¡will¡¡write¡¡two¡¡types¡¡of¡¡source¡¡code£º¡¡source¡¡code¡¡that¡¡organizes¡¡and¡¡source¡¡code¡¡that¡¡¡¡

does¡¡something¡£¡¡Organizational¡¡source¡¡code¡¡is¡¡like¡¡a¡¡filing¡¡system¡¡with¡¡folders¡£¡¡Source¡¡code¡¡¡¡

that¡¡does¡¡something¡¡is¡¡like¡¡a¡¡folder¡¡with¡¡s
·µ»ØĿ¼ ÉÏÒ»Ò³ ÏÂÒ»Ò³ »Øµ½¶¥²¿ ÔÞ£¨11£© ²È£¨11£©
¿ì½Ý²Ù×÷: °´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³ °´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ °´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿!
ÎÂÜ°Ìáʾ£º ο´Ð¡ËµµÄͬʱ·¢±íÆÀÂÛ£¬Ëµ³ö×Ô¼ºµÄ¿´·¨ºÍÆäËüС»ï°éÃÇ·ÖÏíÒ²²»´íŶ£¡·¢±íÊéÆÀ»¹¿ÉÒÔ»ñµÃ»ý·ÖºÍ¾­Ñé½±Àø£¬ÈÏÕæдԭ´´ÊéÆÀ ±»²ÉÄÉΪ¾«ÆÀ¿ÉÒÔ»ñµÃ´óÁ¿½ð±Ò¡¢»ý·ÖºÍ¾­Ñé½±ÀøŶ£¡