1. Trang chủ
  2. » Luận Văn - Báo Cáo

information technology assignment 2 unit programming

56 2 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Programming
Tác giả Nguyen Trung Hoa
Người hướng dẫn Nguyen Hoang Anh Vu
Trường học BTEC FPT International College
Chuyên ngành Information Technology
Thể loại Assignment
Năm xuất bản 2022
Thành phố DaNang
Định dạng
Số trang 56
Dung lượng 1,1 MB

Cấu trúc

  • 2.1.1 Procedure-OrientedProgramming(POP) (11)
  • 2.1.2 Event-drivenprogramming(EDP) (11)
  • 2.1.3 Object-orientedprogramming(OOP) (11)
  • 2.1.4 Therelationshipamong eventdrivenprogramming(EDP)andobject-oriented (0)
  • 2.2 Analyze thecommon featuresthata developer hasaccess toin anIDE(M2) (11)
  • 3.1. WriteaprogramthatimplementsanalgorithmusinganIDE. (P3)(LO3)and (11)
  • 3.2 UsetheIDEtomanage thedevelopmentprocessoftheprogram.(M3) (11)
  • 3.3 Explainthedebuggingprocessandexplain thedebuggingfacilitiesavailablein theIDE. (P4) (11)
  • 3.4 Outlinethecodingstandardyouhaveusedinyourcode.(P5) (11)

Nội dung

First of all, I would like to thank my mentor Nguyen Hoang Anh Vu for hisconstant support in my studies and research, for his patience, motivation,enthusiasm and rich knowledge.. Without

Object-orientedprogramming(OOP)

2.2Analyze thecommon featuresthata developer hasaccess toin anIDE(M2).

3.1 WriteaprogramthatimplementsanalgorithmusinganIDE (P3)(LO3)and determinedebuggingprocessand explaintheimportanceofacodingstandard (LO4)

CHAPTER 2: Explain the characteristics of procedural, object-orientedandevent-drivenprogramming,conductan analysisof a suitableIntegratedDevelopmentEnvironment(LO2)(IDE)

2 Give explanations of what procedural, object-oriented and event- drivenparadigmsare;theircharacteristicsandtherelationshipbetween them.(P2)

Programmingis ajobwhereprogrammersuse availableprogramminglanguages, codes,andutilities tobuildsoftware,programs,applications,games,websites,etc.Users can perform commands with computers or interact with each other through electronic devices.[1]

- Structure-orientedprogramming,alsoknownasprocedure-oriented programming (POP): is a traditional programming technique in which a program is divided into functions

-nowwewill startwithaddition,subtractionmultiplydivision,thensolvetheequationand finallyfindmin, max

-weuse theradiobuttontoswitchto max3tomaketheline Cappeartocalculatethe equation.

-put3 times theadvantage in a, b,c is 2,5, 1we willhavethefollowingresult:

Figure3-6:Thelargestnumber -it'sgreatthatthefunctionsarerunningandtherearenoerrors,allasexpected,ifthe userenters thewrong data,the system willautomaticallynotifythe user,orswitchbackto theerrorcode.

- Forexample, wesolvethe quadraticequationbutdo notusethe radiobuttoncommand todisplaythe linetowriteallthenumberstoperformthecalculation,the systemwillreturn thefollowing:

Whenwewritethewrong code,theprocessisinterruptedbecausethesystemdoesnot understandacertaincode,andreturnstheerrorcode.

-Above we cansee theimportanceof a coding standard.

+A codingstandardensures thatall developerswho write code ina particularlanguage write according to specified guidelines This makes the code easy to understand and providesconsistencyinthecode.

+ One of the most essential elements in a software system is the consistency of the codingstandard.Thisisbecauseitpositivelyaffectsthequalityofthesystem.Whileusing

PerfomedStudent:Nguyen TrungHoa 22 thesoftwaresystem,youneedtoensurethattheprinciplesdonotconflictwitheachother.

Thesource codethatuses thestandardmust also be inharmonywith thestandard.The completed source code should appear as if the code had been written by a single developerinasinglesession.

3.2Usethe IDEto manage thedevelopmentprocessof theprogram.(M3)

-BeforeusingtheIDEtomanagethedevelopmentprocessoftheprogram,weneedto knowifitsupportsthelanguageyouareusing.IwilluseVisualStudiosoftwareandtheC# programminglanguage tomanagetheprogram'sdevelopment process.

Figure3-8:VisualStudio -WhenstartingVisualStudio,itwill displayaninterface with 4 mainfunctions,inaddition, theleftpartistheprojectsthatwehaveworkedon,itwillbestoredanddisplayedonthe left.

-Weclickthiscommand,itwill createanewprojectandI willcreatea projectwithC# languageandstartwithconsole

-afterselectingthelanguageandoperatingsystem,thesystemforprogramming.Atable withtheinformationwillbedisplayedformetonametheproject,wheretostoreit.

-Whentheselection isdone,I will clickCreate to starttheproject,

Figure3-12:VisualStudio5 +Iwillstartwith abasic mathproblem:

+Thefirstis toaddfeaturestothewinforminterfacesothat wecancodetheprogram, withthe projecttocalculate theperimeterandareaofthe rectangle,Iusedthewinform interfacetobuildthefollowing:

+whenI havesuccessfullybuilt theinterfaceframework,Icontinueto useC# languagetocodeit:

+westart byenteringtwo numbersincellAandB respectively5 and3, thesystemwill calculateforusandoutputtheresultto thescreen.

+Error!!!this isabasicerrorinwinform which is“wrongobjectnaming”

3.3Explain the debugging process and explain the debugging facilities availableintheIDE.(P4)

- Debugging is the process of detecting and removing of existing and potential errors(alsocalledas‘bugs’)inasoftwarecodethatcancauseittobehaveunexpectedly orcrash.Topreventincorrectoperationofa softwareorsystem,debuggingisusedtofind and resolve bugs or defects When various subsystems or modules are tightly coupled, debuggingbecomesharderasany changeinonemodulemay causemorebugstoappear inanother.Sometimesittakesmoretimetodebugaprogramthantocodeit.

3.Capturetheprogramsnapshotwhenthebugappears.Trytoget allthevariablevalues andstatesofthe programatthattime.

- Debuggingisa processthattakesalotoftime,especially logicrelatederrorsthatare difficulttofindandfix SoVisualStudioprovidesa debuggingtool,makingdebugging simpler,easierandfaster.

- Thisis acommonerrorwhenweaccidentallydeletethesign {}orforgettousethissign inthe code,this is a branchmarkfor statements,in thestring {}containsC# statements thatwhenthe functionis calledit willexecute.followthelogic ofthecodefromstartto finish,orwhenencounteringthecommandreturn;

-Sometimes wefinish thecode,andstartrunningthe programbutshow an error, because perhapswe forgotoraccidentallydeletedit,causeour programtocrash

-Clickontheerrormessagelineitwilldisplaytheerror codeforus.Andthatwillmakeus awareof errorsandfixthemeasily

Figure3-22:Bug -Withthiserror,wejust needtoaddtheright libraryforthem[using

- Whenwefinishwritingacommandline, wewilladdasemicolon (;),rightafterthecode wewritetoletthe systemknowthatwehaveendedthecurrentcommandline.

- andthefollowingisthemissingsyntaxerror(;)thesystemimmediatelyreportserrors andforces us to fix them.

Figure3-24:Bug -ErrorCS1002 ;expected,fix asfollows:

- The error here is line 30 and 31, when the error, the system provides us information abouttheerror,andweperformtheerror correction.

Figure3-25:FixBug 3.4Outlinethecodingstandardyouhaveusedin your code (P5)

-global variablesshould notbeusedmorethanonce,only whenabsolutelynecessary

-Namethevariableextensively,explainits effect,whyitexists,andthevalueitreturns.

-Name cannot begin with a number It must begin with an underscore _ or a letter character.

- The name given must clarify the meaning, avoid being misled, misinterpreting the problem

-Avoidusingabbreviationsin parameternames andIDs,if abbreviated, useCamelCase fornaming.Namingrules:

Figure:3.26:Namespace Nametheclass,struct,andinterface[8]

- Donameinterfaceswith adjectivephrases, oroccasionally withnounsornoun phrases.

- Doprefixinterface nameswith theletter I, to indicatethat thetypeis aninterface.

-It shouldbeensuredthatthe namesdifferonlyby the"I"prefixonthe interfacename whenyouaredefininganinterface-classpairwheretheclass isastandardimplementation oftheinterface.

- Donamecollectionpropertieswithapluralphrasedescribingtheitemsinthecollection insteadofusingasingularphrasefollowedby"List"or"Collection".

- Donotuse"Before"or"After"prefixesorpostfixestoindicatepre-andpost-events.Use presentandpasttensesasjustdescribed.

- Do namefieldsusing anoun, nounphrase,oradjective.

Example: use winform to solve the problem of calculating the area of the rectangle'sperimeter

CRITICALEVALUATION Through the last report, I have applied the knowledge I have learnedinclassandlearnedonlinetosuccessfullycompletethelesson program.IthinkthatIstillhavesomeshortcomings,Istillhavetolearn more,butIdid mybestandcompletedtheexamassoonaspossible.I willtrynexttime.

CONCLUSION After completing this report, I understood and grasped how to build a basic algorithm, models such as procedural programming, functional procedures, object-orientedand event-oriented programming,

IDE capabilities , debugging programs and compilation processes.

Analyze thecommon featuresthata developer hasaccess toin anIDE(M2)

Explainthedebuggingprocessandexplain thedebuggingfacilitiesavailablein theIDE (P4)

Outlinethecodingstandardyouhaveusedinyourcode.(P5)

CHAPTER 2: Explain the characteristics of procedural, object-orientedandevent-drivenprogramming,conductan analysisof a suitableIntegratedDevelopmentEnvironment(LO2)(IDE)

2 Give explanations of what procedural, object-oriented and event- drivenparadigmsare;theircharacteristicsandtherelationshipbetween them.(P2)

Programmingis ajobwhereprogrammersuse availableprogramminglanguages, codes,andutilities tobuildsoftware,programs,applications,games,websites,etc.Users can perform commands with computers or interact with each other through electronic devices.[1]

- Structure-orientedprogramming,alsoknownasprocedure-oriented programming (POP): is a traditional programming technique in which a program is divided into functions

-nowwewill startwithaddition,subtractionmultiplydivision,thensolvetheequationand finallyfindmin, max

-weuse theradiobuttontoswitchto max3tomaketheline Cappeartocalculatethe equation.

-put3 times theadvantage in a, b,c is 2,5, 1we willhavethefollowingresult:

Figure3-6:Thelargestnumber -it'sgreatthatthefunctionsarerunningandtherearenoerrors,allasexpected,ifthe userenters thewrong data,the system willautomaticallynotifythe user,orswitchbackto theerrorcode.

- Forexample, wesolvethe quadraticequationbutdo notusethe radiobuttoncommand todisplaythe linetowriteallthenumberstoperformthecalculation,the systemwillreturn thefollowing:

Whenwewritethewrong code,theprocessisinterruptedbecausethesystemdoesnot understandacertaincode,andreturnstheerrorcode.

-Above we cansee theimportanceof a coding standard.

+A codingstandardensures thatall developerswho write code ina particularlanguage write according to specified guidelines This makes the code easy to understand and providesconsistencyinthecode.

+ One of the most essential elements in a software system is the consistency of the codingstandard.Thisisbecauseitpositivelyaffectsthequalityofthesystem.Whileusing

PerfomedStudent:Nguyen TrungHoa 22 thesoftwaresystem,youneedtoensurethattheprinciplesdonotconflictwitheachother.

Thesource codethatuses thestandardmust also be inharmonywith thestandard.The completed source code should appear as if the code had been written by a single developerinasinglesession.

3.2Usethe IDEto manage thedevelopmentprocessof theprogram.(M3)

-BeforeusingtheIDEtomanagethedevelopmentprocessoftheprogram,weneedto knowifitsupportsthelanguageyouareusing.IwilluseVisualStudiosoftwareandtheC# programminglanguage tomanagetheprogram'sdevelopment process.

Figure3-8:VisualStudio -WhenstartingVisualStudio,itwill displayaninterface with 4 mainfunctions,inaddition, theleftpartistheprojectsthatwehaveworkedon,itwillbestoredanddisplayedonthe left.

-Weclickthiscommand,itwill createanewprojectandI willcreatea projectwithC# languageandstartwithconsole

-afterselectingthelanguageandoperatingsystem,thesystemforprogramming.Atable withtheinformationwillbedisplayedformetonametheproject,wheretostoreit.

-Whentheselection isdone,I will clickCreate to starttheproject,

Figure3-12:VisualStudio5 +Iwillstartwith abasic mathproblem:

+Thefirstis toaddfeaturestothewinforminterfacesothat wecancodetheprogram, withthe projecttocalculate theperimeterandareaofthe rectangle,Iusedthewinform interfacetobuildthefollowing:

+whenI havesuccessfullybuilt theinterfaceframework,Icontinueto useC# languagetocodeit:

+westart byenteringtwo numbersincellAandB respectively5 and3, thesystemwill calculateforusandoutputtheresultto thescreen.

+Error!!!this isabasicerrorinwinform which is“wrongobjectnaming”

3.3Explain the debugging process and explain the debugging facilities availableintheIDE.(P4)

- Debugging is the process of detecting and removing of existing and potential errors(alsocalledas‘bugs’)inasoftwarecodethatcancauseittobehaveunexpectedly orcrash.Topreventincorrectoperationofa softwareorsystem,debuggingisusedtofind and resolve bugs or defects When various subsystems or modules are tightly coupled, debuggingbecomesharderasany changeinonemodulemay causemorebugstoappear inanother.Sometimesittakesmoretimetodebugaprogramthantocodeit.

3.Capturetheprogramsnapshotwhenthebugappears.Trytoget allthevariablevalues andstatesofthe programatthattime.

- Debuggingisa processthattakesalotoftime,especially logicrelatederrorsthatare difficulttofindandfix SoVisualStudioprovidesa debuggingtool,makingdebugging simpler,easierandfaster.

- Thisis acommonerrorwhenweaccidentallydeletethesign {}orforgettousethissign inthe code,this is a branchmarkfor statements,in thestring {}containsC# statements thatwhenthe functionis calledit willexecute.followthelogic ofthecodefromstartto finish,orwhenencounteringthecommandreturn;

-Sometimes wefinish thecode,andstartrunningthe programbutshow an error, because perhapswe forgotoraccidentallydeletedit,causeour programtocrash

-Clickontheerrormessagelineitwilldisplaytheerror codeforus.Andthatwillmakeus awareof errorsandfixthemeasily

Figure3-22:Bug -Withthiserror,wejust needtoaddtheright libraryforthem[using

- Whenwefinishwritingacommandline, wewilladdasemicolon (;),rightafterthecode wewritetoletthe systemknowthatwehaveendedthecurrentcommandline.

- andthefollowingisthemissingsyntaxerror(;)thesystemimmediatelyreportserrors andforces us to fix them.

Figure3-24:Bug -ErrorCS1002 ;expected,fix asfollows:

- The error here is line 30 and 31, when the error, the system provides us information abouttheerror,andweperformtheerror correction.

Figure3-25:FixBug 3.4Outlinethecodingstandardyouhaveusedin your code (P5)

-global variablesshould notbeusedmorethanonce,only whenabsolutelynecessary

-Namethevariableextensively,explainits effect,whyitexists,andthevalueitreturns.

-Name cannot begin with a number It must begin with an underscore _ or a letter character.

- The name given must clarify the meaning, avoid being misled, misinterpreting the problem

-Avoidusingabbreviationsin parameternames andIDs,if abbreviated, useCamelCase fornaming.Namingrules:

Figure:3.26:Namespace Nametheclass,struct,andinterface[8]

- Donameinterfaceswith adjectivephrases, oroccasionally withnounsornoun phrases.

- Doprefixinterface nameswith theletter I, to indicatethat thetypeis aninterface.

-It shouldbeensuredthatthe namesdifferonlyby the"I"prefixonthe interfacename whenyouaredefininganinterface-classpairwheretheclass isastandardimplementation oftheinterface.

- Donamecollectionpropertieswithapluralphrasedescribingtheitemsinthecollection insteadofusingasingularphrasefollowedby"List"or"Collection".

- Donotuse"Before"or"After"prefixesorpostfixestoindicatepre-andpost-events.Use presentandpasttensesasjustdescribed.

- Do namefieldsusing anoun, nounphrase,oradjective.

Example: use winform to solve the problem of calculating the area of the rectangle'sperimeter

CRITICALEVALUATION Through the last report, I have applied the knowledge I have learnedinclassandlearnedonlinetosuccessfullycompletethelesson program.IthinkthatIstillhavesomeshortcomings,Istillhavetolearn more,butIdid mybestandcompletedtheexamassoonaspossible.I willtrynexttime.

CONCLUSION After completing this report, I understood and grasped how to build a basic algorithm, models such as procedural programming, functional procedures, object-orientedand event-oriented programming,

IDE capabilities , debugging programs and compilation processes.

Ngày đăng: 10/05/2024, 22:12

TỪ KHÓA LIÊN QUAN