Page 2Word 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 wit
Trang 1Page 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
Trang 3Submission 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 http://cms.btec.edu.vn/
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
Trang 4Page 1
Tasks
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
Trang 5● An evaluation of developing applications using an IDE versus developing an application without using
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
Trang 6Page 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) –
Trang 7Task 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
Trang 8Page 3
organisations of using them
(Word limit: 500 700 words) –
Learning Outcomes and Assessment Criteria
Trang 9Pass 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
Trang 10Page 4
the 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
Trang 112.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
Popular Features: 8
Explain the debugging process and explain the debugging facilities available in the IDE (P4) 9
Definition Debugging: 9
Debug process: 9
Step 1: Locate the error: this was done to assist us to locate the error's precise position on the user's website so we can solve it more quickly Finding the problem now will save time later and cut down on errors overall 9
Evaluate how the debugging process can be used to help develop more secure, robust applications (M4) 12 Write 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
Trang 12Page 5
Coding conventions target: 2
Naming Convention: 2
Statement Convention: 4
Layout: 5
Comments: 6
REFERENCES 1
Trang 13Give 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:
Trang 14Page 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
Trang 15+ Example:
Picture 2: Event-driven code 1
Trang 16Page 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
Trang 17+ Example
Picture 4: Object-Oriented code 1
Trang 18Page 3
Trang 19Picture 5 Object-Oriented code 2 :
Picture 6: Object-Oriented code 3
Trang 20Page 4
Trang 21Picture 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
Trang 22+ Data and functions are independent of one another
+ In software, data may move around at will
+ It is simple to comprehend a program's logic
+ A function can call another function to obtain its data
- Advantages:
+ The code is made clearer and easier to comprehend
Trang 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
- Advantages:
+ From tiny to big systems, OOP systems are simple to update
+ The task may be divided up into projects based on things quite easily
+ We may reduce duplicate code and increase the utility of existing classes by utilizing inheritance
Trang 24Page 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:
Trang 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
Trang 26Page 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
Trang 27Picture 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
Trang 28Page 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
Trang 29Explain the debugging process and explain the debugging facilities available in the IDE (P4)
Trang 30Page 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
Trang 31Picture 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
Trang 32Page 10
Trang 33Picture 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
Trang 34Page 11
Picture 12: Run test and checking
Trang 35Evaluate 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
Trang 36Page 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
Trang 37Picture : 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 /
Trang 39Picture 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
Trang 40Page 14