Tải bản đầy đủ - 0 (trang)
Chapter 1. Introduction to Computers, the Internet and World Wide Web

Chapter 1. Introduction to Computers, the Internet and World Wide Web

Tải bản đầy đủ - 0trang

Chapter1.IntroductiontoComputers,

theInternetandWorldWideWeb

Thechiefmeritoflanguageisclearness.

Galen

Ourlifeisfritteredawaybydetail....Simplify,

simplify.

HenryDavidThoreau

Hehadawonderfultalentforpackingthoughtclose,

andrenderingitportable.

ThomasB.Macaulay

Manisstillthemostextraordinarycomputerofall.

JohnF.Kennedy

OBJECTIVES

Inthischapteryouwilllearn:

Basichardwareandsoftwareconcepts.

Basicobject-technologyconcepts,suchasclasses,objects,

attributes,behaviors,encapsulationandinheritance.

Thedifferenttypesofprogramminglanguages.

Whichprogramminglanguagesaremostwidelyused.



AtypicalC++programdevelopmentenvironment.

Thehistoryoftheindustry-standardobject-orientedsystem

modelinglanguage,theUML.

ThehistoryoftheInternetandtheWorldWideWeb.

Totest-driveC++applicationsintwopopularC++

environmentsGNUC++runningonLinuxandMicrosoft's

VisualC++®.NETrunningonWindows®XP.



[Page2]

Outline

1.1Introduction

1.2WhatIsaComputer?

1.3ComputerOrganization

1.4EarlyOperatingSystems

1.5Personal,DistributedandClient/ServerComputing

1.6TheInternetandtheWorldWideWeb

1.7MachineLanguages,AssemblyLanguagesandHigh-Level

Languages

1.8HistoryofCandC++

1.9C++StandardLibrary

1.10HistoryofJava

1.11FORTRAN,COBOL,PascalandAda



1.12Basic,VisualBasic,VisualC++,C#and.NET

1.13KeySoftwareTrend:ObjectTechnology

1.14TypicalC++DevelopmentEnvironment

1.15NotesAboutC++andC++HowtoProgram,5/e

1.16Test-DrivingaC++Application

1.17SoftwareEngineeringCaseStudy:IntroductiontoObject

TechnologyandtheUML(Required)

1.18Wrap-Up

1.19WebResources

Summary

Terminology

Self-ReviewExercises

AnswerstoSelf-ReviewExercises

Exercises



[Page2(continued)]



1.1.Introduction

WelcometoC++!Wehaveworkedhardtocreatewhatwehope

youwillfindtobeaninformative,entertainingandchallenging

learningexperience.C++isapowerfulcomputerprogramming

languagethatisappropriatefortechnicallyorientedpeoplewith

littleornoprogrammingexperienceandforexperienced

programmerstouseinbuildingsubstantialinformation

systems.C++HowtoProgram,FifthEdition,isaneffective

learningtoolforeachoftheseaudiences.

Thecoreofthebookemphasizesachievingprogramclarity

throughtheproventechniquesofobject-oriented

programmingthisisan"earlyclassesandobjects"

booknonprogrammerswilllearnprogrammingtherightway

fromthebeginning.Thepresentationisclear,straightforward

andabundantlyillustrated.WeteachC++featuresinthe

contextofcompleteworkingC++programsandshowthe

outputsproducedwhenthoseprogramsarerunona

computerwecallthisthelive-codeapproach.Theexample

programsareincludedontheCDthataccompaniesthisbook,

oryoumaydownloadthemfromwww.deitel.comor

www.prenhall.com/deitel.

Theearlychaptersintroducethefundamentalsofcomputers,

computerprogrammingandtheC++computerprogramming

language,providingasolidfoundationforthedeepertreatment

ofC++inthelaterchapters.Experiencedprogrammerstendto

readtheearlychaptersquickly,thenfindthetreatmentofC++

intheremainderofthebookbothrigorousandchallenging.



[Page3]

Mostpeopleareatleastsomewhatfamiliarwiththeexciting



thingscomputersdo.Usingthistextbook,youwilllearnhowto

commandcomputerstodothosethings.Computers(often

referredtoashardware)arecontrolledbysoftware(i.e.,the

instructionsyouwritetocommandthecomputertoperform

actionsandmakedecisions).C++isoneoftoday'smost

popularsoftwaredevelopmentlanguages.Thistextprovidesan

introductiontoprogrammingintheversionofC++standardized

intheUnitedStatesthroughtheAmericanNational

StandardsInstitute(ANSI)andworldwidethroughthe

effortsoftheInternationalOrganizationfor

Standardization(ISO).

Computeruseisincreasinginalmosteveryfieldofendeavor.

Computingcostshavebeendecreasingdramaticallydueto

rapiddevelopmentsinbothhardwareandsoftware

technologies.Computersthatmighthavefilledlargeroomsand

costmillionsofdollarsafewdecadesagocannowbeinscribed

onsiliconchipssmallerthanafingernail,costingafewdollars

each.(Thoselargecomputerswerecalledmainframesandare

widelyusedtodayinbusiness,governmentandindustry.)

Fortunately,siliconisoneofthemostabundantmaterialson

earthit'saningredientincommonsand.Siliconchiptechnology

hasmadecomputingsoeconomicalthataboutabilliongeneralpurposecomputersareinuseworldwide,helpingpeoplein

business,industryandgovernment,andintheirpersonallives.

Overtheyears,manyprogrammerslearnedtheprogramming

methodologycalledstructuredprogramming.Youwilllearn

structuredprogrammingandanexcitingnewermethodology,

object-orientedprogramming.Whydoweteachboth?Object

orientationisthekeyprogrammingmethodologyusedby

programmerstoday.Youwillcreateandworkwithmany

softwareobjectsinthistext.Youwilldiscoverhowever,that

theirinternalstructureisoftenbuiltusingstructuredprogrammingtechniques.Also,thelogicofmanipulatingobjects

isoccasionallyexpressedwithstructuredprogramming.

Youareembarkingonachallengingandrewardingpath.Asyou



proceed,ifyouhaveanyquestions,pleasesende-mailto

deitel@deitel.com

Wewillrespondpromptly.TokeepuptodatewithC++

developmentsatDeitel&Associates,pleaseregisterforourfree

e-mailnewsletter,theDeitel®BuzzOnline,at

www.deitel.com/newsletter/subscribe.html

WehopethatyouwillenjoylearningwithC++HowtoProgram,

FifthEdition.







[Page3(continued)]



1.2.WhatIsaComputer?

Acomputerisadevicecapableofperformingcomputations

andmakinglogicaldecisionsatspeedsmillions(evenbillions)

oftimesfasterthanhumanbeingscan.Forexample,manyof

today'spersonalcomputerscanperformabillionadditionsper

second.Apersonoperatingadeskcalculatorcouldspendan

entirelifetimeperformingcalculationsandstillnotcompleteas

manycalculationsasapowerfulpersonalcomputercanperform

inonesecond!(Pointstoponder:Howwouldyouknowwhether

thepersonaddedthenumberscorrectly?Howwouldyouknow

whetherthecomputeraddedthenumberscorrectly?)Today's

fastestsupercomputerscanperformtrillionsofadditionsper

second!

Computersprocessdataunderthecontrolofsetsof

instructionscalledcomputerprograms.Theseprogramsguide

thecomputerthroughorderlysetsofactionsspecifiedbypeople

calledcomputerprogrammers.



[Page4]

Acomputerconsistsofvariousdevicesreferredtoashardware

(e.g.,thekeyboard,screen,mouse,harddisk,memory,DVDs

andprocessingunits).Theprogramsthatrunonacomputer

arereferredtoassoftware.Hardwarecostshavebeendeclining

dramaticallyinrecentyears,tothepointthatpersonal

computershavebecomeacommodity.Inthisbook,youwill

learnprovenmethodsthatarereducingsoftwaredevelopment

costsobject-orientedprogrammingand(inouroptionalSoftware

EngineeringCaseStudyinChapters27,9and13)objectorienteddesign.







[Page4(continued)]



1.3.ComputerOrganization

Regardlessofdifferencesinphysicalappearance,virtuallyevery

computermaybeenvisionedasdividedintosixlogicalunits

orsections:

1. Inputunit.Thisisthe"receiving"sectionofthecomputer.

Itobtainsinformation(dataandcomputerprograms)from

inputdevicesandplacesthisinformationatthedisposalof

theotherunitsforprocessing.Mostinformationisentered

intocomputersthroughkeyboardsandmousedevices.

Informationalsocanbeenteredinmanyotherways,

includingbyspeakingtoyourcomputer,scanningimages

andhavingyourcomputerreceiveinformationfroma

network,suchastheInternet.

2. Outputunit.Thisisthe"shipping"sectionofthecomputer.

Ittakesinformationthatthecomputerhasprocessedand

placesitonvariousoutputdevicestomakethe

informationavailableforuseoutsidethecomputer.Most

informationoutputfromcomputerstodayisdisplayedon

screens,printedonpaperorusedtocontrolotherdevices.

Computersalsocanoutputtheirinformationtonetworks,

suchastheInternet.

3. Memoryunit.Thisistherapid-access,relativelylowcapacity"warehouse"sectionofthecomputer.Itstores

computerprogramswhiletheyarebeingexecuted.It

retainsinformationthathasbeenenteredthroughtheinput

unit,sothatitwillbeimmediatelyavailableforprocessing

whenneeded.Thememoryunitalsoretainsprocessed

informationuntilitcanbeplacedonoutputdevicesbythe

outputunit.Informationinthememoryunitistypicallylost

whenthecomputer'spoweristurnedoff.Thememoryunit

isoftencalledeithermemoryorprimarymemory.



[Historically,thisunithasbeencalled"corememory,"but

thattermisfadingfromusetoday.]

4. Arithmeticandlogicunit(ALU).Thisisthe

"manufacturing"sectionofthecomputer.Itisresponsible

forperformingcalculations,suchasaddition,subtraction,

multiplicationanddivision.Itcontainsthedecision

mechanismsthatallowthecomputer,forexample,to

comparetwoitemsfromthememoryunittodetermine

whethertheyareequal.

5. Centralprocessingunit(CPU).Thisisthe

"administrative"sectionofthecomputer.Itcoordinatesand

supervisestheoperationoftheothersections.TheCPUtells

theinputunitwheninformationshouldbereadintothe

memoryunit,tellstheALUwheninformationfromthe

memoryunitshouldbeusedincalculationsandtellsthe

outputunitwhentosendinformationfromthememoryunit

tocertainoutputdevices.Manyoftoday'scomputershave

multipleCPUsand,hence,canperformmanyoperations

simultaneouslysuchcomputersarecalledmultiprocessors.



[Page5]

6. Secondarystorageunit.Thisisthelong-term,highcapacity"warehousing"sectionofthecomputer.Programs

ordatanotactivelybeingusedbytheotherunitsnormally

areplacedonsecondarystoragedevices,suchasyourhard

drive,untiltheyareagainneeded,possiblyhours,days,

monthsorevenyearslater.Informationinsecondary

storagetakesmuchlongertoaccessthaninformationin

primarymemory,butthecostperunitofsecondarystorage

ismuchlessthanthatofprimarymemory.Othersecondary

storagedevicesincludeCDsandDVDs,whichcanhold

hundredsofmillionsofcharactersandbillionsofcharacters,

respectively.



[Page5(continued)]



1.4.EarlyOperatingSystems

Earlycomputerscouldperformonlyonejobortaskatatime.

Thisisoftencalledsingle-userbatchprocessing.The

computerrunsasingleprogramatatimewhileprocessingdata

ingroupsorbatches.Intheseearlysystems,usersgenerally

submittedtheirjobstoacomputercenterondecksofpunched

cardsandoftenhadtowaithoursorevendaysbeforeprintouts

werereturnedtotheirdesks.

Softwaresystemscalledoperatingsystemsweredevelopedto

makeusingcomputersmoreconvenient.Earlyoperating

systemssmoothedandspeededupthetransitionbetweenjobs,

andhenceincreasedtheamountofwork,orthroughput,

computerscouldprocess.

Ascomputersbecamemorepowerful,itbecameevidentthat

single-userbatchprocessingwasinefficient,becausesomuch

timewasspentwaitingforslowinput/outputdevicesto

completetheirtasks.Itwasthoughtthatmanyjobsortasks

couldsharetheresourcesofthecomputertoachievebetter

utilization.Thisisachievedbymultiprogramming.

Multiprogramminginvolvesthesimultaneousoperationofmany

jobsthatarecompetingtosharethecomputer'sresources.

Withearlymultiprogrammingoperatingsystems,usersstill

submittedjobsondecksofpunchedcardsandwaitedhoursor

daysforresults.

Inthe1960s,severalgroupsinindustryandtheuniversities

pioneeredtimesharingoperatingsystems.Timesharingisa

specialcaseofmultiprogramminginwhichusersaccessthe

computerthroughterminals,typicallydeviceswithkeyboards

andscreens.Dozensorevenhundredsofuserssharethe

computeratonce.Thecomputeractuallydoesnotrunthemall

simultaneously.Rather,itrunsasmallportionofoneuser'sjob,



thenmovesontoservicethenextuser,perhapsproviding

servicetoeachuserseveraltimespersecond.Thus,theusers'

programsappeartoberunningsimultaneously.Anadvantageof

timesharingisthatuserrequestsreceivealmostimmediate

responses.







Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 1. Introduction to Computers, the Internet and World Wide Web

Tải bản đầy đủ ngay(0 tr)

×