Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (966.86 KB, 86 trang )
<span class="text_page_counter">Trang 1</span><div class="page_container" data-page="1">
Page 1
ASSIGNMENT 2 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 1: Programming
Submission date 29, June 2022 Date Received 1st submission
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice.
Student’s signature An
</div><span class="text_page_counter">Trang 3</span><div class="page_container" data-page="3">Submission Format:
Format: The submission is in the form of an individual written report. This should be written in a concise, formal business style using single spacing and font size 12. You are required to make use of headings, paragraphs and subsections as appropriate, and all work must be supported with research and referenced using the Harvard referencing system. Please also provide a bibliography using the Harvard referencing system.
Submission Students are compulsory to submit the assignment in due date and in a way requested by the Tutors. The form of submission will be a soft copy in PDF posted on corresponding course of
Note: The Assignment must be your own work, and not copied by or from another student or from books etc. If you use ideas, quotes or data (such as diagrams) from books, journals or other sources, you must reference your sources, using the Harvard style. Make sure that you know how to reference properly, and that understand the guidelines on plagiarism. If you do not, you definitely get fail
Assignment Brief and Guidance:
Scenario: You have applied for a post as a trainee with a software development company and have been invited for an interview. You have been passed the presentation to demonstrate your problem solving and basic programming skills. Now you are given a more challenge task to create a fully working, secure application that has been developed using an IDE and adheres to coding standards for a detailed business problem.
</div><span class="text_page_counter">Trang 4</span><div class="page_container" data-page="4">Page 1Tasks
You will discuss a suitable problem with your mentor and list the user requirements before designing, implementing (coding) and testing a solution. You will create a report that should include:
● Introduction to your program (list of requirements and screenshots of program)
● Explain some of programming paradigms. Evaluate why and how your program use these (or some of) paradigms.
● Explain the common features of an IDE should have and evidence of how the IDE was used to manage the development of your code.
</div><span class="text_page_counter">Trang 5</span><div class="page_container" data-page="5">● An evaluation of developing applications using an IDE versus developing an application without using an IDE.
● An explanation and evaluation of the debugging process in the IDE used and how it helped with development.
● An explanation and evaluation of coding standards used in your program and the benefits to organisations of using them.
The working application produced must also be demonstrated together with the presentation.
Guidance
Task 1 Introduction to your program –
In this part, you will have to present the list of user requirements of your application before designing the solution. Then, you will give a brief explanation how your application could solve the problem.
The application has to allow user to enter inputs and perform specific CRUD (Create / Read / Update / Delete) actions.
Some topics you can consider are: - Student Management - Gradebook Management - Inventory Management - Etc.
</div><span class="text_page_counter">Trang 6</span><div class="page_container" data-page="6">Page 2
(Word limit: 100 250 words) –
Task 2 Explain programming paradigms –
Next, you will need to explain what procedural, object-oriented (Class and Object) and event-driven paradigms are with their characteristics. Source code with explanations need to be included to justify these paradigms.
Then, you will explain why and how your program use these (or some of) paradigms. (Word limit: 1000 1200 words) –
</div><span class="text_page_counter">Trang 7</span><div class="page_container" data-page="7">Task 3 IDE features–
Before jumping to the implementation phase, you will present the chosen IDE to develop the application. You will the common features of an IDE should have and evidence (e.g. screenshots) of how the IDE was used to manage the development of your code.
Then, you will give:
- An evaluation of developing applications using an IDE versus developing an application without using an IDE.
- An explanation and evaluation of the debugging process in the IDE used and how it helped with development.
- Evidences that you have used debugging during the implementation (Word limit: 500 700 words) –
Task 4 Design, implement and test –
Next, you will give the design of your application by using suitable diagrams such as: Flowchart, Activitydiagram to describe its behaviours before implementing it.
When your application is finally implemented, you will need to include evidences (source code, result images) to show how it is implemented and works properly with explanations. Test cases have to be included to make sure the application works without any error or exception.
Finally, you have to explain and evaluate coding standards used in your program and the benefits to
</div><span class="text_page_counter">Trang 8</span><div class="page_container" data-page="8">Page 3
organisations of using them.
(Word limit: 500 700 words) –
Learning Outcomes and Assessment Criteria
</div><span class="text_page_counter">Trang 9</span><div class="page_container" data-page="9">Pass Merit Distinction
LO2 Explain the characteristics of procedural, object-oriented and event-driven programming, conduct an analysis of a suitable Integrated Development Environment (IDE)
P2 Give explanations of what procedural, object-oriented and event-driven paradigms are; their characteristics and the relationship between them.
M2 Analyse the common features that a developer has access to in an IDE.
D2 Critically evaluate the source code of an application which implements the programming paradigms, in terms of the code structure and characteristics.
LO3 Implement basic algorithms in code using an IDE
LO4 Determine the debugging process and explain the importance of a coding standard
P3 Write a program that implements an algorithm using an IDE.
M3 Use the IDE to manage the development process of the program.
D3 Evaluate the use of an IDE for development of applications contrasted with not using an IDE.
P4 Explain the debugging process and explain the debugging facilities available in
M4 Evaluate how the debugging process can be used to help develop more secure, robust
D4 Critically evaluate why a coding standard is necessary in a team as well as for the individual.
</div><span class="text_page_counter">Trang 10</span><div class="page_container" data-page="10">Page 4the IDE.
P5 Outline the coding standard you have used in your code.
applications.
Contents
Give explanations of what procedural, object-oriented, and event-driven paradigms are; their
characteristics, and the relationship between them (P2) ... 1
</div><span class="text_page_counter">Trang 11</span><div class="page_container" data-page="11">2.1.1 The definition of programming models ... 1
2.1.2 The characteristics and advantages, disadvantages of the 3 models ... 5
Procedural programming ... 5
Object-oriented programming ... 6
Event-driven programming ... 6
2.1.3 Relationship between Procedural, Object-oriented, Event-driven. ... 7
Analyze the common features that a developer has access to in an IDE (M2) ... 7
Evaluate how the debugging process can be used to help develop more secure, robust applications (M4) 12Write a program that implements an algorithm using an IDE & (M3) Uses the IDE to manage the development process of the program (P3) ... 1
Outline the coding standard you have used in your code (P5) ... 2
Coding Conventions: ... 2
</div><span class="text_page_counter">Trang 13</span><div class="page_container" data-page="13">Give explanations of what procedural, object-oriented, and event-driven paradigms are; their characteristics, and the relationship between them (P2)
2.1.1 The definition of programming models
- Definition of procedural programming: Procedural programming is a programming paradigm, it follows a sequence of instructions and conveys it to the computer. This paradigm follows a linear top-down approach or a linear and treats data and procedures as two different entities. They put a lot of emphasis on dividing programs into named groups of instructions called procedures, which are similar to functions. In short, procedural programming instructs devices on how to complete the task logically step-by-step.
+ Example:
</div><span class="text_page_counter">Trang 14</span><div class="page_container" data-page="14">Page 1
Picture 1: Procedural code
- The definition of Event-driven programming: Event-driven programming is a programming paradigm in which a program is controlled by new user events, sensor outputs, or messages passing from other programs. They employ event-driven programming in graphical user interfaces and further applications that emphasize specific actions in response to user input.
</div><span class="text_page_counter">Trang 15</span><div class="page_container" data-page="15">+ Example:
Picture 2: Event-driven code 1
</div><span class="text_page_counter">Trang 16</span><div class="page_container" data-page="16">Page 2
Picture 3: Event-driven code 2
- The definition of Object-Oriented Programming: Object Oriented Programming (OOP) is a programming paradigm that relies on the concept of classes and objects allowing programmers to create objects in code that abstracts away objects. Instead of concentrating on the logic necessary to handle them, it concentrates on the objects that developers want to manipulate. OOP provides concepts that help to model complicated systems of the real world into manageable software solutions.
</div><span class="text_page_counter">Trang 17</span><div class="page_container" data-page="17">+ Example
Picture 4: Object-Oriented code 1
</div><span class="text_page_counter">Trang 18</span><div class="page_container" data-page="18">Page 3
</div><span class="text_page_counter">Trang 19</span><div class="page_container" data-page="19">Picture 5 Object-Oriented code 2 :
Picture 6: Object-Oriented code 3
</div><span class="text_page_counter">Trang 20</span><div class="page_container" data-page="20">Page 4
</div><span class="text_page_counter">Trang 21</span><div class="page_container" data-page="21">Picture 7: Object-Oriented code 4
2.1.2 The characteristics and advantages, disadvantages of the 3 models
Procedural programming - Characteristics:
+ The method used in procedural programming is top-down.
</div><span class="text_page_counter">Trang 22</span><div class="page_container" data-page="22">+ The code is made clearer and easier to comprehend.
</div><span class="text_page_counter">Trang 23</span><div class="page_container" data-page="23">+ The execution of algorithms is simple. + It makes the code more reusable.
+ Use several memory regions for various components. - Disadvantages:
+ Data can be hacked
+ It solves real-world problems, but these are often complex programs. + With difficulties from the actual world, it is not very useful.
Object-oriented programming - Characteristics:
+ The focus on objects in object-oriented programming is its primary feature. When a developer specifies objects, OOP is used in its most fundamental form.
+ OOP stresses the encapsulation of data and functionality inside objects as another feature. + The defining of classes is the next feature of object-oriented programming. The blueprint for an object is defined in a class.
</div><span class="text_page_counter">Trang 24</span><div class="page_container" data-page="24">Page 6
necessary. It is not appropriate for all issues.
+ OOP can be a little challenging, therefore programmers need to have excellent designing and programming abilities in addition to careful preparation.
Event-driven programming
- Characteristics: The stream of information or events is at the heart of event-driven programming. Although push (reactive) is its intended application, it may also be employed for pull. It is often used asynchronously and is lazy as opposed to eager. Additionally, it may depict a time series of 0, 1, or infinite values or occurrences. Let's dissect this assertion into its constituent elements.
- Advantages:
</div><span class="text_page_counter">Trang 25</span><div class="page_container" data-page="25">+ With event-driven, you may directly modify the object you want the code for, which may make programming for certain people simpler.
+ With event-driven, the user may choose from a variety of tools in the toolbar to quickly construct the buttons, radio buttons, and other elements they require.
+ It makes it simple for sensors and other devices to communicate with software. - Disadvantages:
+ Event-driven programming is frequently more difficult and time-consuming than batch programming for straightforward systems.
+ When compared to simpler, procedural applications, errors might be harder to notice.
+ Complex GUI programs may take longer to load and operate than simpler ones, especially if RAM is limited.
2.1.3 Relationship between Procedural, Object-oriented, Event-driven.
Although procedural programming is the most beginner-friendly and straightforward, it also has the most errors. Object-oriented programming is the greatest and ideal because it is simpler than functional programming and more secure than procedural programming. Event-oriented programming is the safest but also the least perfect. Despite having nothing in common, procedural programming, event-oriented programming, and object-oriented programming are frequently stacked together to create excellent programs. Programmers can better handle the complexity of very big programs since programs can include hundreds of thousands of lines of code.
Analyze the common features that a developer has access to in an IDE (M2)
- IDE stands for Integrated Development Environment is a comprehensive tool for writing code for
</div><span class="text_page_counter">Trang 26</span><div class="page_container" data-page="26">Page 7
application development. In the IDE, users can create, design, and test any software. The IDE that I am using is very popular with programmers, which is Visual Studio 2022, designed and developed by Microsoft Corporation.
</div><span class="text_page_counter">Trang 27</span><div class="page_container" data-page="27">Picture 8: Visual Studio 2022 interface
Popular Features:
- Text editor: Almost all IDEs come with a text editor. It is employed for modifying text. Enables text entry and editing, primarily for programming language files. Most people use WordPad and Notepad as their text editors.
- Debugger: During testing, a debugger is a tool that aids developers and testers in finding faults and debugging their application software.
- Compiler: A compiler converts a programming language into a computer language so that it may be
</div><span class="text_page_counter">Trang 28</span><div class="page_container" data-page="28">Page 8
processed and analyzed by a computer and then transformed into a more generic form.
- Code completion: Code completion was developed to help developers save time and decrease the likelihood of syntax errors by automatically recognizing and adding common code parts.
- Programming language support: The IDE also enables users to develop code in several languages. However, as IDEs are often only compatible with a single programming language, you need first identify the language in which you currently code before selecting an IDE.
</div><span class="text_page_counter">Trang 29</span><div class="page_container" data-page="29">Explain the debugging process and explain the debugging facilities available in the IDE (P4)
</div><span class="text_page_counter">Trang 30</span><div class="page_container" data-page="30">Page 9
Picture 9: Wrong format error
Step 2: Find the cause of the error: syntax error, declaration error, algorithm error: The first step in figuring out the reason for an issue is to identify it in the program so that we can use that information to search for and correct the problem. Uppercase and lowercase mistakes are examples of syntax errors. The reasons for errors might include logic problems, declaration errors, algorithm errors, algorithm errors, etc.
</div><span class="text_page_counter">Trang 31</span><div class="page_container" data-page="31">Picture 10: Capitalization error
Step 3: Error handling: The practice of reacting to and helping users recover from software failures is known as error handling. It is clear that error handling is the act of anticipating, identifying, and resolving program failures. This includes managing both hardware and software faults and enabling interrupted execution.
</div><span class="text_page_counter">Trang 32</span><div class="page_container" data-page="32">Page 10
</div><span class="text_page_counter">Trang 33</span><div class="page_container" data-page="33">Picture 11: Fix the errors in the photo above
Step 4: Run test and check: This is the last step and also the most important step, after executing the command lines, we have to test and test it in many different cases to fix if there is an error.
</div><span class="text_page_counter">Trang 34</span><div class="page_container" data-page="34">Page 11
Picture 12: Run test and checking
</div><span class="text_page_counter">Trang 35</span><div class="page_container" data-page="35">Evaluate how the debugging process can be used to help develop more secure, robust applications (M4)
- Navigating through Code with the Debugger: To start the debugging process, press the F5 button or select the Start Debugging button on the toolbar. Also clicking the green arrow also helps to start the debugging process (same as F5).
- BreakPoint: Used to mark where you want the debugger, and when to pause program execution. We use breakpoints by clicking on the code bar next to it or pressing F9 on the keyboard.
Picture 13: Use BreakPoint
- Step Over: You might need to run the code line by line after the debugger reaches the breakpoint. Press F10 to execute the code line by line.
</div><span class="text_page_counter">Trang 36</span><div class="page_container" data-page="36">Page 12
Picture 14: Step over
- Step Into: The same function as Step Over. But the difference is, if the highlighted portion of the current sentence is a method call, then the debugger will go inside that method. Press the shortcut “F11” to do it.
</div><span class="text_page_counter">Trang 37</span><div class="page_container" data-page="37">Picture : The current highlighted section is a method 15
Picture : When I press "F11", the debugger goes inside the method 16
- Step Out: When you press "Shift + F11" in the current method to perform Step Out, it completes the execution of the method and pauses at the next statement from where it was called.
- Inspect Variable:
+ During a debugging session, you can observe variables and expressions using the Watch (Debug /
</div><span class="text_page_counter">Trang 39</span><div class="page_container" data-page="39">Picture 17: information in table
- Debug Tips:
+ Identify a possible location for error. Before entering, set the breakpoint.
+ If you are absolutely certain that the function is accurate, use Step Over; otherwise, use Step Into.
+ If you are quite certain that the remainder of the function is accurate, use Step Out; otherwise, use Step Over or Step Into.
+ To skip "clean" parts, remove pointless breaks.
</div><span class="text_page_counter">Trang 40</span><div class="page_container" data-page="40">Page 14
</div>