SlidePub
Home
Categories
Login
Register
Home
Technology
notes on Programming fundamentals
notes on Programming fundamentals
9,319 views
11 slides
Jul 05, 2021
Slide
1
of 11
Previous
Next
1
2
3
4
5
6
7
8
9
10
11
About This Presentation
things to know before you start programming
Size:
122.1 KB
Language:
en
Added:
Jul 05, 2021
Slides:
11 pages
Slide Content
Slide 1
Noteson
ConceptsofProgramming
Instructor:
ArghodeepPaul
FirmwareEngineeratBitBibleTechnologiesPvt.Ltd.
ContentLicenseUnder:OpenSource
Date:05July2021
Slide 2
Computerprogrammingistheactofwritingcomputerprograms,whicharea
sequenceofinstructionswrittenusingaComputerProgrammingLanguageto
performaspecifiedtaskbythecomputer.
IntroductiontoComputerProgram
Beforegettingintocomputerprogramming,letusfirstunderstandcomputer
programsandwhattheydo.
AcomputerprogramisasequenceofinstructionswrittenusingaComputer
ProgrammingLanguagetoperformaspecifiedtaskbythecomputer.
Thetwoimportanttermsthatwehaveusedintheabovedefinitionare−
Sequenceofinstructions
ComputerProgrammingLanguage
Tounderstandtheseterms,considerasituationwhensomeoneasksyouabouthow
togotoanearbyKFC.WhatexactlydoyoudototellhimthewaytogotoKFC?
YouwilluseHumanLanguagetotellthewaytogotoKFC,somethingasfollows−
Firstgostraight,afterhalfkilometer,takeleftfromtheredlightand
thendrivearoundonekilometerandyouwillfindKFCattheright.
Here,youhaveusedEnglishLanguagetogiveseveralstepstobetakentoreachKFC.
Iftheyarefollowedinthefollowingsequence,thenyouwillreachKFC−
1.Gostraight
2.Drivehalfkilometer
3.Takeleft
4.Drivearoundonekilometer
5.SearchforKFCatyourrightside
Slide 3
Now,trytomapthesituationwithacomputerprogram.Theabovesequenceof
instructionsisactuallyaHumanProgramwritteninEnglishLanguage,which
instructsonhowtoreachKFCfromagivenstartingpoint.Thissamesequencecould
havebeengiveninSpanish,Hindi,Arabic,oranyotherhumanlanguage,provided
thepersonseekingdirectionknowsanyoftheselanguages.
Now,let'sgobackandtrytounderstandacomputerprogram,whichisasequence
ofinstructionswritteninaComputerLanguagetoperformaspecifiedtaskbythe
computer.FollowingisasimpleprogramwritteninPythonprogrammingLanguage
−
print"Hello,World!"
Theabovecomputerprograminstructsthecomputertoprint"Hello,World!"on
thecomputerscreen.
Acomputerprogramisalsocalledacomputersoftware,whichcanrange
fromtwolinestomillionsoflinesofinstructions.
Computerprograminstructionsarealsocalledprogramsourcecode
andcomputerprogrammingisalsocalledprogramcoding.
Acomputerwithoutacomputerprogramisjustadumpbox;itisprograms
thatmakecomputersactive.
Aswehavedevelopedsomanylanguagestocommunicateamongourselves,
computerscientistshavedevelopedseveralcomputer-programminglanguagesto
provideinstructionstothecomputer(i.e.,towritecomputerprograms).Wewillsee
severalcomputerprogramminglanguagesinthesubsequentchapters.
Slide 4
IntroductiontoComputer
Programming
Ifyouunderstoodwhatacomputerprogramis,thenwewillsay:theactofwriting
computerprogramsiscalledcomputerprogramming.
Aswementionedearlier,therearehundredsofprogramminglanguages,whichcan
beusedtowritecomputerprogramsandfollowingareafewofthem−
Java
C
C++
Python
PHP
Perl
Ruby
UsesofComputerPrograms
Todaycomputerprogramsarebeingusedinalmosteveryfield,household,
agriculture,medical,entertainment,defense,communication,etc.Listedbeloware
afewapplicationsofcomputerprograms−
MSWord,MSExcel,AdobePhotoshop,InternetExplorer,Chrome,etc.,are
examplesofcomputerprograms.
Computerprogramsarebeingusedtodevelopgraphicsandspecialeffectsin
moviemaking.
ComputerprogramsarebeingusedtoperformUltrasounds,X-Rays,andother
medicalexaminations.
ComputerprogramsarebeingusedinourmobilephonesforSMS,Chat,and
voicecommunication.
Slide 5
ComputerProgrammer
Someonewhocanwritecomputerprogramsorinotherwords,someonewhocan
docomputerprogrammingiscalledaComputerProgrammer.
Basedoncomputerprogramminglanguageexpertise,wecannameacomputer
programmersasfollows−
CProgrammer
C++Programmer
JavaProgrammer
PythonProgrammer
PHPProgrammer
PerlProgrammer
RubyProgrammer
Algorithm,PseudocodeandProgram
Algorithm:Systematiclogicalapproachwhichisawell-defined,step-by-step
procedurethatallowsacomputertosolveaproblem.
Pseudocode:ItisasimplerversionofaprogrammingcodeinplainEnglishwhich
usesshortphrasestowritecodeforaprogrambeforeitisimplementedinaspecific
programminglanguage.
Program:Itisexactcodewrittenforproblemfollowingalltherulesofthe
programminglanguage.
Slide 6
Algorithm
Analgorithmisusedtoprovideasolutiontoaparticularprobleminformofwell-
definedsteps.Wheneveryouuseacomputertosolveaparticularproblem,the
stepswhichleadtothesolutionshouldbeproperlycommunicatedtothecomputer.
Whileexecutinganalgorithmonacomputer,severaloperationssuchasadditions
andsubtractionsarecombinedtoperformmorecomplexmathematicaloperations.
Algorithmscanbeexpressedusingnaturallanguage,flowcharts,etc.
Let’stakealookatanexampleforabetterunderstanding.Asaprogrammer,weare
allawareoftheLinearSearchprogram.
Algorithmoflinearsearch:
1.Startfromtheleftmostelementofarr[]and
onebyonecomparexwitheachelementofarr[].
2.Ifxmatcheswithanelement,returntheindex.
3.Ifxdoesn’tmatchwithanyofelements,return-1.
Here,wecanseehowthestepsofalinearsearchprogramareexplainedinasimple,
Englishlanguage.
Slide 7
Pseudocode
Itisoneofthemethodswhichcanbeusedtorepresentanalgorithmforaprogram.
Itdoesnothaveaspecificsyntaxlikeanyoftheprogramminglanguagesandthus
cannotbeexecutedonacomputer.Thereareseveralformatswhichareusedto
writepseudo-codesandmostofthemtakedownthestructuresfromlanguagessuch
asC,Lisp,FORTRAN,etc.
Manytimealgorithmsarepresentedusingpseudocodesincetheycanbereadand
understoodbyprogrammerswhoarefamiliarwithdifferentprogramminglanguages.
PseudocodeallowsyoutoincludeseveralcontrolstructuressuchasWhile,If-then-
else,Repeat-until,forandcase,whichispresentinmanyhigh-levellanguages.
Note:Pseudocodeisnotanactualprogramminglanguage.
PeudocodeforLinearSearch:
FUNCTIONlinearSearch(list,searchTerm):
FORindexFROM0->length(list):
IFlist[index]==searchTermTHEN
RETURNindex
ENDIF
ENDLOOP
RETURN-1
ENDFUNCTION
Slide 8
Inhere,wehaven’tusedanyspecificprogramminglanguagebutwrotethesteps
ofalinearsearchinasimplerformwhichcanbefurthermodifiedintoaproper
program.
Program
Aprogramisasetofinstructionsforthecomputertofollow.Themachinecan’tread
aprogramdirectly,becauseitonlyunderstandsmachinecode.Butyoucanwrite
stuffinacomputerlanguage,andthenacompilerorinterpretercanmakeit
understandabletothecomputer.
ProgramforLinearSearch:
//C++codeforlinearlysearchxinarr[].Ifx
//ispresentthenreturnitslocation,otherwise
//return-1
intsearch(intarr[],intn,intx)
{
inti;
for(i=0;i<n;i++)
if(arr[i]==x)
returni;
return-1;
}
AlgorithmvsPsuedocodevsProgram
1.Analgorithmisdefinedasawell-definedsequenceofstepsthatprovides
asolutionforagivenproblem,whereasapseudocodeisoneofthemethods
thatcanbeusedtorepresentanalgorithm.
2.Whilealgorithmsaregenerallywritteninanaturallanguageorplain
Englishlanguage,pseudocodeiswritteninaformatthatissimilartothe
structureofahigh-levelprogramminglanguage.Programontheotherhand
allowsustowriteacodeinaparticularprogramminglanguage.
So,asdepictedaboveyoucanclearlyseehowthealgorithmisusedtogenerate
thepseudocodewhichisfurtherexpandedbyfollowingaparticularsyntaxofa
programminglanguagetocreatethecodeoftheprogram.
Slide 9
ElementsofPLs
WeassumeyouarewellawareofEnglishLanguage,whichisawell-knownHuman
InterfaceLanguage.Englishhasapredefinedgrammar,whichneedstobefollowed
towriteEnglishstatementsinacorrectway.Likewise,mostoftheHumanInterface
Languages(Hindi,English,Spanish,French,etc.)aremadeofseveralelementslike
verbs,nouns,adjectives,adverbs,propositions,andconjunctions,etc.
SimilartoHumanInterfaceLanguages,ComputerProgrammingLanguagesarealso
madeofseveralelements.Wewilltakeyouthroughthebasicsofthoseelements
andmakeyoucomfortabletousetheminvariousprogramminglanguages.These
basicelementsinclude−
ProgrammingEnvironment
BasicSyntax
DataTypes
Variables
Keywords
BasicOperators
DecisionMaking
Loops
Numbers
Characters
Arrays
Strings
Functions
FileI/O
Wewillexplainalltheseelementsinsubsequentchapterswithexamplesusing
differentprogramminglanguages.First,wewilltrytounderstandthemeaningofall
thesetermsingeneralandthen,wewillseehowthesetermscanbeusedin
differentprogramminglanguages.
Thistutorialhasbeendesignedtogiveyouanideaaboutthefollowingmost
popularprogramminglanguages−
Slide 10
CProgramming
JavaProgramming
PythonProgramming
AmajorpartofthetutorialhasbeenexplainedbytakingCasprogramming
languageandthenwehaveshownhowsimilarconceptsworkinJavaandPython.
Soaftercompletionofthistutorial,youwillbequitefamiliarwiththesepopular
programminglanguages.
ProgrammingEnvironment
EnvironmentSetupisnotanelementofanyProgrammingLanguage,itisthefirst
steptobefollowedbeforesettingontowriteaprogram.
WhenwesayEnvironmentSetup,itsimplyimpliesabaseontopofwhichwecan
doourprogramming.Thus,weneedtohavetherequiredsoftwaresetup,i.e.,
installationonourPCwhichwillbeusedtowritecomputerprograms,compile,and
executethem.
Aprogrammingenvironmentsisthecollectionoftoolsusedinthedevelopmentof
software.
Thiscollectionmayconsist:-
Afilesystem,
Atexteditor,
Alinker,
Acompiler,
Integratedtools
Thesetoolsmaybeaccessthroughauniforminterface(GUI).
Someoftheexamplesofprogrammingenvironmentsare-
1)MicrosoftVisualStudio.NET,whichisalargecollectionofsoftwaredevelopment
tools,usedthroughawindowsinterface.
Itisusedtodevelopsoftwareinfollowinglanguages-
C#,
VisualBasic.NET,
JScript(MSJavaScriptversion),
J#(MSJavaversion),
Slide 11
managedC++.
2)NetBeans
3)TurboC,C++
4)Dreamweaver
5)Arduino,etc.
Tags
programming
programming fundamental
Categories
Technology
Download
Download Slideshow
Get the original presentation file
Quick Actions
Embed
Share
Save
Print
Full
Report
Statistics
Views
9,319
Slides
11
Favorites
2
Age
1611 days
Related Slideshows
11
8-top-ai-courses-for-customer-support-representatives-in-2025.pptx
JeroenErne2
48 views
10
7-essential-ai-courses-for-call-center-supervisors-in-2025.pptx
JeroenErne2
47 views
13
25-essential-ai-courses-for-user-support-specialists-in-2025.pptx
JeroenErne2
37 views
11
8-essential-ai-courses-for-insurance-customer-service-representatives-in-2025.pptx
JeroenErne2
34 views
21
Know for Certain
DaveSinNM
21 views
17
PPT OPD LES 3ertt4t4tqqqe23e3e3rq2qq232.pptx
novasedanayoga46
26 views
View More in This Category
Embed Slideshow
Dimensions
Width (px)
Height (px)
Start Page
Which slide to start from (1-11)
Options
Auto-play slides
Show controls
Embed Code
Copy Code
Share Slideshow
Share on Social Media
Share on Facebook
Share on Twitter
Share on LinkedIn
Share via Email
Or copy link
Copy
Report Content
Reason for reporting
*
Select a reason...
Inappropriate content
Copyright violation
Spam or misleading
Offensive or hateful
Privacy violation
Other
Slide number
Leave blank if it applies to the entire slideshow
Additional details
*
Help us understand the problem better