0% found this document useful (0 votes)
134 views34 pages

File - 20211027 - 154730 - GCS200060 - Tran Lam Bao Tran - Assignment2

The document provides instructions for Assignment 2 of a BTEC Level 5 HND Diploma in Computing unit on programming. It asks the student to create a fully functioning application using an integrated development environment (IDE) that addresses a business problem. The application must be demonstrated along with a report discussing the programming paradigms used, features of the IDE, debugging process, and coding standards. The assignment aims to assess the student's ability to explain programming concepts, implement an algorithm using an IDE, and determine the importance of debugging and coding standards.

Uploaded by

Châu Trần
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
134 views34 pages

File - 20211027 - 154730 - GCS200060 - Tran Lam Bao Tran - Assignment2

The document provides instructions for Assignment 2 of a BTEC Level 5 HND Diploma in Computing unit on programming. It asks the student to create a fully functioning application using an integrated development environment (IDE) that addresses a business problem. The application must be demonstrated along with a report discussing the programming paradigms used, features of the IDE, debugging process, and coding standards. The assignment aims to assess the student's ability to explain programming concepts, implement an algorithm using an IDE, and determine the importance of debugging and coding standards.

Uploaded by

Châu Trần
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

ASSIGNMENT 2 FRONTSHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 1: Programming

Submission date Date Received 1st submission

Re-submission date Date Received 2nd submission

Student name TRAN LAM BAO TRAN Student ID GCS200060

Class GCS0902_NX Assessor name HUYNH THI MY TRANG

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 tran

Grading grid
P2 P3 P4 P5 M2 M3 M4 D2 D3 D4
 Summative:  Re-submission Feedback:

Grade: Assessor Signature: Date:

Lecturer Signature:

ASSIGNMENT 2 BRIEF

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 1: programming

Assignment title Application development with IDE

Academic year

Unit tutor

Issue date Submission date


Submission Format:
Format: The submission is in the form of an individual written report. This should be
written in a console, formal business style using single spacing and font size 12. You are
required to make use of headings, paragraphs and subsection 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.greenwich.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 idea, 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.
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.
• 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 organizations of using them.

The working application produced must also be demonstrated together with the presentation.
Learning Outcomes and Assessment Criteria

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 M2 Analyze the common D2 Critically evaluate the


procedural, object-oriented features that a developer has source code of an application
and event-driven paradigms access to in an IDE. which implements the
are; their characteristics and programming paradigms, in
the relationship between terms of the code structure
and characteristics.
them.

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 M3 Use the IDE to manage D3 Evaluate the use of an IDE
implements an algorithm the development process of for development of
using an IDE. the program. applications contrasted with
not using an IDE.

P4 Explain the debugging M4 Evaluate how the D4 Critically evaluate why a


process and explain the debugging process can be coding standard is necessary
debugging facilities available used to help develop more in a team as well as for the
in the IDE. secure, robust applications. individual.

P5 Outline the coding


standard you have used in
your code.
Table of Contents

P2. Explanations of what procedural, object-orientated and event-driven paradigms are; their
characteristics and the relationship between them. ................................................................................ 8
1. Procedural Paradigm.................................................................................................................... 8
1.1. Define .................................................................................................................................. 8
1.2. Characteristics...................................................................................................................... 8
1.3. Example ............................................................................................................................... 9
2. Object-orientated Paradigm ....................................................................................................... 10
2.1. Define ................................................................................................................................ 10
2.2. Characteristics.................................................................................................................... 10
2.3. Example ............................................................................................................................. 11
3. Event-driven paradigms ............................................................................................................. 12
3.1. Define ................................................................................................................................ 12
3.2. Characteristics.................................................................................................................... 12
3.3. Example ............................................................................................................................. 13
4. Relationship ............................................................................................................................... 13
4.1. Procedural vs oop............................................................................................................... 13
4.2. Oop vs event-driven paradigms .......................................................................................... 14
4.3. Procedural vs event-driven paradigms ................................................................................ 14
M2. Analyze the common features that a developer has access to in an IDE. ......................................... 15
1. Present from create new project by IDE ......................................................................................... 15
2. Create new class ............................................................................................................................ 15
3. Create new form ............................................................................................................................ 15
4. Run project .................................................................................................................................... 15
D2. Critical evaluation the source code of an application which implements the programming paradigms,
in terms of the code structure. .............................................................................................................. 15
1. Describe about the relationship between procedure programming vs OOP ................................ 15
1.1. Give source code for them and compare each other........................................................... 15
P3. Write a program that implements an algorithm using an IDE. .......................................................... 15
1. Source code for classes .............................................................................................................. 15
2. All form UI ................................................................................................................................. 16
3. Events source code .................................................................................................................... 19
4. Solution explorer ....................................................................................................................... 23
M3. Use the IDE to manage the development process of the program. ................................................. 28
1. Present Microsoft Visual Studio to manage the development process........................................ 28
D3. Evaluate the use of an IDE for development of applications contrasted with not using an IDE. ........ 28
1. Compare Visual Studio and Notepad++ to develop application................................................... 28
P4. Explain the debugging process and explain the debugging facilities available in the IDE. .................. 28
1. Explain the debugging process in the IDE (Visual Studio) ............................................................ 28
1.1. Set break a point ................................................................................................................ 28
1.2. Start debug ........................................................................................................................ 29
1.3. All step for debug ............................................................................................................... 30
2. Explain the debugging facilities available in the IDE .................................................................... 31
M4. Evaluate how the debugging process can be used to help develop more secure, robust applications.
.............................................................................................................................................................. 31
1. How to use debugging to finding bug ......................................................................................... 31
2. Breakpoint ................................................................................................................................. 31
3. Exception setting ....................................................................................................................... 31
4. Output ....................................................................................................................................... 31
5. Diagnostic tool ........................................................................................................................... 31
6. Task windows ............................................................................................................................ 31
7. Watch window ........................................................................................................................... 31
8. Autos window ............................................................................................................................ 31
9. Local window ............................................................................................................................. 31
10. Live Visual Tree ...................................................................................................................... 31
11. Call stack ................................................................................................................................ 31
12. Memory ................................................................................................................................. 32
P5. Outline the coding standard you have used in your code. ................................................................ 32
1. How is coding standard, class, properties, method, constant, … ................................................. 32
2. Give some examples from your source code .............................................................................. 32
D4. Critically evaluate why a coding standard is necessary in a team as well as for the individual. ......... 33
REFERENCES .......................................................................................................................................... 34
P2. Explanations of what procedural, object-orientated and event-
driven paradigms are; their characteristics and the relationship
between them.
1. Procedural Paradigm
1.1. Define
Procedural programming is a list of instruction to make computer what to do step by
step and how to display code. In procedural programming, a large program is broken
down into smaller manageable parts (also called procedures or functions), a program
basically includes of a sequence of instructions each of which tells the computer to do
something like reading inputs from the user, doing the necessary calculation or
displaying output.

1.2. Characteristics
- A large program is broken down into small manageable procedures or
functions.
- Different functions can share data via global variables.
- Functions can change global data.
- Top-down methodology.
1.3. Example
o A typical example for procedural programming is C programming
language, C++, PHP, python, …
o We can apply by creating bank account or something

- Getting an account to deposit or withdraw funds (getAccount, deposit,


withdraw).
- Transferring funds between two different accounts (transfer).
- Recording all changes that occur with all accounts (accounts).
2. Object-orientated Paradigm
2.1. Define
Object Oriented programming (OOP) is a programming paradigm which depends
on the concept of classes and objects. It is used to structure a software program
into simple, reusable pieces of code blueprints (classes), which are used to
create individual instances of objects.
2.2. Characteristics
- Class definition:
o A class is an abstraction of similar objects, can be seen as an abstract
data type.
o A class consists of class name, attributes, methods.

- Objects:
o Include state (is represented by attribute of object), behavior (is
represented by method of an object), identity (provide an unique
name to an object
- Abstraction:
o Data Abstraction may also be defined as the process of identifying
only the required characteristics of an object ignoring the irrelevant
details.
- Encapsulation:
o We can define the meaning of encapsulation by wrapping up of data
under a single unit. Encapsulation also prevent the data from
accessed by the code outside.
- Inheritance:
o Reusability and extension of existing classes
- Polymorphism:
o Multiple definitions for a single name - functions with same name
with different functionality; saves time in investing many function
names Operator and Function overloading
- Generic class:
o Class definitions for unspecified data
o Known as container classes
o Flexible and reusable
- Class library:
o Built-in language specific classes
- Message passing:
o Objects communicates through invoking methods and sending data to
them.
o This feature of sending and receiving information among objects
through function parameters is known as Message Passing
2.3. Example
- we use in many languages: C#, java, PHP, Python, …
- we will still use bank account for this example
➢ this is main program

➢ to run program we need class bank account, deposit and current


account.
3. Event-driven paradigms
3.1. Define
o Event-driven programming is a programming paradigm in which the flow of the
program is determined by events such as user actions (mouse clicks, key
presses), sensor outputs, or messages from other programs or threads.
3.2. Characteristics
o Service orientated: S.O is a programming paradigm which is used to make programs
that are made for services. If user request a command (for example: User want to
close an application, they click on the X button on the top-right window (Windows
OS).
o Time Driven: Time driven in event driven programming is a paradigm, it is code that
runs on a time trigger, this could be a piece of code that runs at a specific time,
which could be once a week or whenever a program is launched, this means it is a
pre-set task.
o Trigger Function: Trigger functions decide what code is going to be executed when a
specific event such as a button is pressed, a data is added…. Nearly every single
application have a trigger function for user to interact with in every kind of OS
(Windows, Chrome OS, iOS, Android, …).
o Event handlers: Event handler is a function or method that takes place when a
certain event happens, they are executed in response to a certain event that takes
place.
o Events (Mouse, keyboard and user interface): include mouse, keyboard and user
interface, which is need to be triggered in the program to execute what user want
the program to do (Delete button, Search button…)
3.3. Example
o We can use in C#, java script, …
o When we create a form and add some button or label on it, we double click to
appear code that is an event

4. Relationship
4.1. Procedural vs OOP
Procedural Programming Object-Orientated programming
Program is divided in small parts called Program is divided in small parts
FUNCTIONS called OBJECTS

Feature: top-down approach Feature: bottom-up approach

No access specifier Access specifier: private, public, …

Not easy to add new data and function Easy to add new data and function

Less secure More secure

Function is more important than data Data is more important than function

4.2. OOP vs event-driven paradigms (EDP)


- OOP and EDP can be used together.
- Every feature of OOP keeps in touch with EDP (when use together)
- In OOP with EDP objects acquire some mechanism of publishing event
notifications and subscribing to event notifications from other objects.
- OOP without EDP control moves from one object to another object on a
method call. Object mainly invokes methods of other objects.
- OOP with EDP control moves from one object to another object on an event
notification.
4.3. Procedural vs event-driven paradigms (EDP)
Procedural paradigm EDP

Provides character user interface to Provides graphical user interface to


write the commands create the programs

Commands are written in linear Actions are defined on events. These


fashion and executed also in linear events could be happened by mouse
fashion clicking and moving or keyboard
stroke.

Focus on sequential execution of Focus on selecting user interface


steps
Most common languages which Most common languages which
follow this paradigm are C#, Visual follow this paradigm are Basic,
Basic Fortran and COBOL
M2. Analyze the common features that a developer has access to in an
IDE.
1. Present from create new project by IDE
2. Create new class
3. Create new form
4. Run project

D2. Critical evaluation the source code of an application which


implements the programming paradigms, in terms of the code
structure.
1. Describe about the relationship between procedure programming
vs OOP
1.1. Give source code for them and compare each other

P3. Write a program that implements an algorithm using an IDE.


Problem: Write a supermarket management program consists of home screen, input
merchandise, check merchandise and bill (in this program I don’t write code of bill). All
accessible through menu strip.

1. Source code for classes


2. All form UI
➢ Home screen
- Label: “ SuperMarket”
- Picture Box: SuperMarketImage
- Menu Strip: file, exit, edit, input merchandise, check quantity, order, print bill
- From this home screen we can choose any option in menu strip to change
another form
➢ Input merchandise
- Label: merchandise info, ID, Name, Quantity, Price
- Text Box: ID, Name, Quantity, Price
- Button: add, delete, edit, export to file
- Data Grid View: ID, Name, Quantity, Price
- Menu strip: file, exit, edit, input merchandise, check quantity, order, print bill
- In this we must enter in 4 text box ID, Name, Quantity, Price and then choose
1 of 3 option below Add, Edit or Delete. When we enter data, it will appear in
datagridview.

➢ Check merchandise
- Label: query criterial, inventory quantity
- Text box: inventory quantity
- Button: search
- Data grid view: ID, Name, Quantity, Price
- Menu strip: file, exit, edit, input merchandise, check quantity, order, print bill
- In this form data is saved form input merchandise to here and we just need
to enter quantity and “enter” or click button search to get the result.

➢ Bill
- Label: customer info, ID, Name, OrderID, Date, Total, After Save Off
- Text box: , ID, Name, OrderID, Total, After Save Off
- Combo box: date
- Button: order detail
- Data grid view: combo box product, quantity, price
3. Events source code
➢ Home screen
- Initialize list

- Menu strip

➢ Input merchandise
- Initialize list
- Menu strip

- Button add

- Button delete
- Button edit

- Data grid view 1

- Form load

➢ Check merchandise
- Initialize

- Menu strip
- Button search

- Form load

➢ Bill
- Initialize

- Menu strip
4. Solution explorer
➢ All class

➢ Home screen
➢ Input merchandise
➢ Check merchandise
➢ Bill
M3. Use the IDE to manage the development process of the program.
1. Present Microsoft Visual Studio to manage the development
process

D3. Evaluate the use of an IDE for development of applications


contrasted with not using an IDE.
1. Compare Visual Studio and Notepad++ to develop application

P4. Explain the debugging process and explain the debugging facilities
available in the IDE.
1. Explain the debugging process in the IDE (Visual Studio)
- Debugging is the process of detecting ang removing of existing and potential
errors.
- Debugging help prevent incorrect operation of a software or a system, also
find and fix some bugs.
- Sometimes debugging takes much time than to code or logical errors
1.1. Set break a point
- Before debugging we must set break a point in any line we want to debug.
- You can click on grey column next to column line to set break point.

- or you can select a line and press F9 > choose debug > toggle breakpoint.

- or right-click and select breakpoint and choose insert breakpoint.

1.2. Start debug


To start debugging, we just need press F5 or click start on your IDE
1.3. All step for debug
- Breakpoint (1.2)
- Step over
o After debugger hits the breakpoint, you need to execute the code line
by line.
o “step over” or F10 command is used to execute the code line by line

- Simply inspect variables


o you can hover over a variable to view the current value in a data tip
- Step into
o this step is the same as step over but the only difference is if the
current highlighted section is any methods call, the debugger will go
inside the method
o shortcut key for step into is “F11”.
- Step out
o This is related when you are debugging inside a method.
o If you press shift +F11 within the current method, then the execution
will complete the execution of the method and will pause at the next
statement from where it called.
- Run to cursor
o To run to the cursor location, place the cursor on an executable line
of code in a source window. On the editor’s context menu (right-click
in the editor), choose Run to cursor. This is like setting a temporary
breakpoint.
- Inspect variables
o The Locals (CTRL+ALT+V,L) window displays variables that are defined
in the local scope, which is generally the function or method that is
currently being executed.
o The Autos (CTRL+ALT+V, A) window displays variables used around
the current line (the place where the debugger is stopped). Exactly
which variables displayed is different in different languages.

- Inspect variables
o You can use the Watch (Debug / Windows / Watch / Watch (1, 2, 3,
4)) and QuickWatch (right-click on variable / Debug / QuickWatch)
windows to watch variables and expressions during a debugging
session.
o The difference is that the Watch window can display several
variables, while the QuickWatch window displays a single variable at a
time.
2. Explain the debugging facilities available in the IDE
- The debugger provides debugging facilities like stepping and breakpoints,
and graphical interface for browsing the state of the control stack in a paused
application thread, allowing you to examine local variables and arguments in
each stack frame.

M4. Evaluate how the debugging process can be used to help develop
more secure, robust applications.
1. How to use debugging to finding bug
2. Breakpoint
3. Exception setting
4. Output
5. Diagnostic tool
6. Task windows
7. Watch window
8. Autos window
9. Local window
10. Live Visual Tree
11. Call stack
12. Memory

P5. Outline the coding standard you have used in your code.
1. How is coding standard, class, properties, method, constant, …
- A coding standard gives a uniform appearance to the codes written by different
engineers
- It improves readability, and maintainability of the code and it reduces complexity
also
- It helps in code reuse and helps to detect error easily
- It promotes sound programming practices and increases efficiency of the
programmers
2. Give some examples from your source code
➢ Name convention
- Capitalization rules
o Name that representing types must be mixed begin with upper case
letter and end with lower case. Example: InputMerchandise

o Variable names must be mixed start with lower case letter and end
with upper case first letter. Example: listObjectMerchandise

- Naming component rules


o Function should be return and procedures should be named after
what they do. Example:

➢ Layout convention
o Use the default Code Editor settings (smart indenting, four-character
indents, tabs saved as spaces). For more information, see Options,
Text Editor, C#, Formatting.

o Write only one statement per line.

o Write only one declaration per line.

o If continuation lines are not indented automatically, indent them one-


tab stop (four spaces).

o Add at least one blank line between method definitions and property
definitions.
➢ Comment convention

o Comment should only be placed in a separate line for


complex formula, detail protocol, ….
o Use // in one line to comment. Example:

D4. Critically evaluate why a coding standard is necessary in a team as


well as for the individual.
REFERENCES
1. https://hackr.io/blog/procedural-programming
2. https://www.techopedia.com/definition/21481/procedural-
programming
3. https://www.geeksforgeeks.org/differences-between-
procedural-and-object-oriented-programming/
4. https://www.tuannguyen.tech/2019/05/programming-
paradigms-what-is-procedural-programming/
5. https://www.quora.com/What-are-examples-of-procedural-
programming-languages
6. https://www.geeksforgeeks.org/c-sharp-abstraction/
7. https://economictimes.indiatimes.com/definition/debugging
8. http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=
%2Fcom.qnx.doc.ide.userguide%2Ftopic%2Fdebug_Base_.html
9. https://opendylan.org/documentation/getting-started-
ide/debug.html
10. https://www.geeksforgeeks.org/coding-standards-and-
guidelines/
11. https://www.perforce.com/resources/qac/coding-standards

You might also like