ComputerProgram
Thursday,October30,2014
3:48PM
ComputerProgram, set of instructionsthatdirectsacomputertoperformsomeprocessingfunction
[Link],acomputermustexecute a
program,thatis,thecomputerreadstheprogram,andthenfollowsthestepsencodedinthe
[Link],with
eachexecutionyieldingapotentiallydifferentresultdependingupontheoptionsanddatathatthe
usergivesthecomputer.
Programs fall into twomajorclasses:[Link]
programisonethatcarriesoutsomefunctiondirectlyforauser,suchaswordprocessingorgame
[Link]
anddevicesconnectedtoit,suchasRAM(randomaccessmemory),harddrives,monitors,
keyboards,printers,andmodems,[Link]
operatingsystemsareDOS,Windows95,OS/2,andUNIX.
II.
PROGRAMDEVELOPMENT
Software designers createnewprogramsbyusingspecialapplicationsprograms,oftencalled
[Link]
[Link]
editor,theprogrammercreatesatextfile,whichisanorderedlistofinstructions,alsocalledthe
[Link]
[Link],aspecialapplicationsprogramtranslatesthesourcecodeintomachine
language,orobjectcodeaformatthattheoperatingsystemwillrecognizeasaproperprogram
andbeabletoexecute.
Three types of applicationsprogramstranslatefromsourcecodetoobjectcode:compilers,
interpreters,[Link]
languages,buttheyservethesamepurposeoftranslatingfromaprogramminglanguageinto
[Link];AssemblyLanguage.
A compiler translatestextfileswritteninahighlevelprogramminglanguagesuchasFortran,C,or
[Link]
interpretedlanguagessuchasBASIC,APLandLISP,inwhichaprogramistranslatedintoobjectcode
[Link]
thattheycanbeginexecutingtheprogramimmediatelyinsteadofhavingtowaitforallofthesource
[Link]
[Link]
execute,sincetheentireprogrammustbetranslatedoneinstructionatatime,eachtimethe
[Link],compiledlanguagesarecompiledonlyonceandthuscanbe
[Link],compiled
languagesaremorecommonandarealmostalwaysusedinprofessionalandscientificapplications.
Another type of translatoristheassembler,whichisusedforprogramsorpartsofprogramswritten
[Link],butitismuchmore
[Link],asingle
[Link],assembly
languageisrarelyusedtowriteanentireprogram,butisinsteadmostoftenusedwhenthe
programmerneedstodirectlycontrolsomeaspectofthecomputersfunction.
Programs are often writtenasasetofsmallerpieces,witheachpiecerepresentingsomeaspectof
[Link],aprogramcalleda
linkercombinesallofthetranslatedpiecesintoasingleexecutableprogram.
Programs seldom work correctlythefirsttime,soaprogramcalledadebuggerisoftenusedtohelp
[Link]
andpointtheprogrammerbacktotheoriginoftheeventintheprogramcode.
Recent programming systems,suchasJava,useacombinationofapproachestocreateandexecute
[Link]
intermediateprogramsarethentransferredovertheInternetintocomputerswhereaninterpreter
Program Page 1
programthenexecutestheintermediateformasanapplicationprogram.
III.
PROGRAMELEMENTS
Most programs are builtfromjustafewkindsofstepsthatarerepeatedmanytimesindifferent
[Link]
somecomputation,andthenproceedstothenextstepintheprogram,intheorderspecifiedbythe
programmer.
Programs often need torepeatashortseriesofstepsmanytimes,forinstanceinlookingthrougha
[Link].
One of the capabilitiesthatmakescomputerssousefulistheirabilitytomakeconditionaldecisions
[Link]
statementsimplementthisfunctionbytestingsomepieceofdataandthenselectingoneoftwo
[Link]
beagoto statementthatdirectsthecomputertoselectitsnextinstructionfromadifferentpartof
[Link],aprogrammightcomparetwonumbersandbranchtoadifferentpartof
theprogramdependingontheresultofthecomparison:
Ifxisgreaterthany
then
goto instruction#10
else continue
Programs often use a [Link]
groupedtogetherintoasubroutine, whichcanthenbecalled,oraccessed,asneededindifferent
[Link],thecomputerrememberswhereitwas
intheprogramwhenthecallwasmade,sothatitcanreturnthereuponcompletionofthe
[Link],aprogramcanspecifythatdifferentdatabeusedbythesubroutine,
allowingaverygeneralpieceofcodetobewrittenonceandusedinmultipleways.
Most programs use [Link],
procedures,libraryroutines,systemroutines, [Link]
computesomevalue,suchascomputationsofangles,whichthecomputercannotcomputewitha
[Link],suchassortingasetof
[Link]
[Link]
someservicefortheapplicationprograms,[Link]
routinesthatareaddedtoanoperatingsystemtoallowthecomputertocommunicatewithanew
device,suchasascanner,modem,[Link]
[Link],which
isusefulif,forinstance,acolorprinterneedstoberealignedtoattainthebestprintingqualityafter
changinganinkcartridge.
IV.
PROGRAMFUNCTION
Modern computers usuallystoreprogramsonsomeformofmagneticstoragemediathatcanbe
accessedrandomlybythecomputer,suchastheharddrivediskpermanentlylocatedinthe
computer,[Link],calleddirectories,indicate
thenamesofthevariousprogramsonthedisk,whentheywerewrittentothedisk,andwherethe
[Link]
applicationprogram,theoperatingsystemlooksthroughthesedirectories,locatestheprogram,and
[Link](centralprocessingunit)tostart
[Link]
programpreparethecomputertoprocessinformationbylocatingfreememorylocationsinRAMto
holdworkingdata,retrievingcopiesofthestandardoptionsanddefaultstheuserhasindicatedfrom
adisk,anddrawinginitialdisplaysonthemonitor.
The application programrequestsacopyofanyinformationtheuserentersbymakingacalltoa
[Link].
Theapplicationthenusesthisinformationtodecidewhattodonextforexample,performsome
desiredprocessingfunctionsuchasreformattingapageoftext,orobtainsomeadditional
[Link],callstoothersystemroutinesareusedto
Program Page 2
actuallycarryoutthedisplayoftheresultsortheaccessingofthefilefromthedisk.
When the application reachescompletionorispromptedtoquit,itmakesfurthersystemcallsto
[Link]
[Link]
theRAMandanydevicesthattheapplicationwasusingandawaitsacommandfromtheuserto
startanotherprogram.
V.
HISTORY
People have been storingsequencesofinstructionsintheformofaprogramforseveralcenturies.
Musicboxesofthe18thcenturyandplayerpianosofthelate19thandearly20thcenturiesplayed
musicalprogramsstoredasseriesofmetalpins,orholesinpaper,witheachline(ofpinsorholes)
representingwhenanotewastobeplayed,andthepinorholeindicatingwhatnotewastobe
playedatthattime.Moreelaboratecontrolofphysicaldevicesbecamecommonintheearly1800s
withFrenchinventorJosephMarieJacquardsinventionofthepunchcardcontrolledweavingloom.
Intheprocessofweavingaparticularpattern,variouspartsoftheloomhadtobemechanically
[Link],Jacquardusedasinglepapercardtorepresenteach
positioningoftheloom,[Link]
entiretapestrycouldbeencodedontoadeckofsuchcards,withthesamedeckyieldingthesame
tapestrydesigneachtimeitwasused.Programsofover24,000cardsweredevelopedandused.
The worlds first programmablemachinewasdesignedalthoughneverfullybuiltbytheEnglish
mathematicianandinventor,[Link],calledtheAnalyticalEngine,used
punchcardssimilartothoseusedintheJacquardloomtoselectthespecificarithmeticoperationto
[Link]
[Link],
[Link]
completedbecausethetechnologyrequiredtobuilditdidnotexistatthetime.
The first card deck programsfortheAnalyticalEngineweredevelopedbyBritishmathematician
CountessAugustaAdaLovelace,[Link]
astheworldsfirstprogrammer.
The modern concept ofaninternallystoredcomputerprogramwasfirstproposedbyHungarian
[Link]
[Link],programscanbeviewed
[Link]
programstorageandexecutionincomputers.
VI.
THEFUTURE
The field of computersciencehasgrownrapidlysincethe1950sduetotheincreaseintheiruse.
Computerprogramshaveundergonemanychangesduringthistimeinresponsetouserneedand
[Link],distributed
computing,andartificialintelligence,haveradicallyalteredthetraditionalconceptsthatonce
determinedprogramformandfunction.
Computer scientists workinginthefieldofparallelcomputing,inwhichmultipleCPUscooperateon
thesameproblematthesametime,haveintroducedanumberofnewprogrammodels(seeParallel
Processing).Inparallelcomputingpartsofaproblemareworkedonsimultaneouslybydifferent
processors,[Link]
engineerswhodesignprogramsforparallelprocessingcomputers,becauseoftheextreme
complexityofthesystemsandthedifficultyinvolvedinmakingthemoperateaseffectivelyas
possible.
Another type of parallelcomputingcalleddistributedcomputingusesCPUsfrommany
[Link]
[Link]
becomingaparticularlyusefulformofdistributedcomputing,especiallywithprogramming
[Link],auserlogsontoaWebsiteanddownloadsaJava
[Link],itcommunicateswithotherprograms
atitshomewebsite,andmayalsocommunicatewithotherprogramsrunningondifferent
computersorwebsites.
Research into artificialintelligence(AI)[Link]
programs, forexample,donotconsistofindividualinstructionsforthecomputertofollowblindly,
Program Page 3
butinsteadconsistofsetsofrules:[Link]
engineusestheserulestoreasonitswaytoaconclusionwhenpresentedwithanewproblem.
Applicationsoflogicprogramsincludeautomaticmonitoringofcomplexsystems,andproving
mathematicaltheorems.
A radically differentapproachtocomputinginwhichthereisnoprogramintheconventionalsense
[Link]
elements,[Link]
processinginthewaythatatraditionalcomputerdoes,aneuralnetworkprocessesinformation
[Link]
isaccomplishedbypresentingitwithknownpatternsofinputandoutputdataandadjustingthe
relativeimportanceoftheinterconnectionsbetweentheprocessingelementsuntilthedesired
[Link],
butunliketraditionalcomputerprograms,neuralnetworksareabletolearnfromtheirexperience.
MORESOURCES
WebLinks
FurtherReading
ALSOINENCARTA
RelatedArticles
Timeline
ContributedBy:
[Link]
Howtocitethisarticle:
Kogge,PeterM."ComputerProgram."MicrosoftStudent2008[DVD].Redmond,WA:Microsoft
Corporation,2007.
RelatedArticles
Computer
ProgrammingLanguages
Software
seealso ComputerScience
applications
More
WebSites(1)
AinsworthComputerSeminar
Thisprivatelymaintainedsiteoffersinformationabouthowcomputerprogramswork,structured
bothforthebeginnerandforthemoreadvancedstudent.
[Link]
FurtherReading(1)
ComputerProgrammingandProgrammingLanguages
ShowAll
VisualBrowser
TaketheTour
[Link].
Program Page 4