Higher Nationals in Computing: Assignment No.2
Higher Nationals in Computing: Assignment No.2
Higher Nationals in Computing: Assignment No.2
Programming
ASSIGNMENT
No.2
Class: GCS0803B
ID: GCS18036
Assignment due: 19/03/2020
Assignment submitted: 1 7 / 0 3 / 2 0 2 0
ASSIGNMENT 2 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing
Nguyễn
Student Name Phúc Student ID GCS18036
Khang
Nguyễn Văn
Class GCS0703B Assessor name
Sơn
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
Grading grid
P2 P3 P4 P5 M2 M3 M4 D2 D3 D4
Academic Year
Unit Tutor
Submission
Issue date
date
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 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 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.
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 organisations of using them.
The working application produced must also be demonstrated together with the
presentation.
P4 Explain the debugging M4 Evaluate how the debugging D4 Critically evaluate why a
process and explain the process can be used to help coding standard is necessary in
debugging facilities available develop more secure, robust a team as well as for the
in the IDE. applications. individual.
P5 Outline the coding
standard you have used in
your code.
Table of Contents
P2 Give explanation of what procedural, object-oriented and event-driven paradigms are;
their characteristics and the relationship between them…………………………………….1
P3 Write a program that implements an algorithm using an IDE…………………………….5
P4 Explain the debugging process and explain the debugging facilities available in the IDE..13
P5 Outline the coding standard you have used in your code………………………………..15
Reference…………………………………………………………………………………….16
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.
Procedural programming:
Definition :
Procedural programming is a programming paradigm that uses a linear or top-
down approach. It relies on procedures or subroutines to perform computations.
In procedural programming, a program consists of data and modules/procedures
that operate on the data.
1
o Avoids the need for redundant code: Repeat instruction can be
written as a function, which can be called its is need.
Facilitates re-usability: Create in one program can be used In others.
Object-orientated programming:
Definition:
Object Oriented Programming (OOP) is programming object orientation, object
programming method as the basis for the construction of algorithms, building the
program. In fact this is not a new method which is a new look in the programming.
We can imagine by the name of it that this algorithm solve the problem from
small to large by observing and imagining the actions, characteristics of real-life
entity and bring into programming as a virtual object. Through the class, object
which act as the function (method) and the main characteristics are the variables. Or
we could say that OOP is the art of observing of objects in their natural appearance
and trying to capture the functional abstractnesses in descriptive programming way,
and to visualize them as virtual-workable objects
2
Definition:
In software development, event-driven programming is a programming model in
which all business processing (business logic) are made in the source code of the
program. The stream processors at runtime of the program will be determined based
on events. Events here may refer to:
Click on the button on the screen.
Press the key on the keyboard.
Hover .
Timeout .
The output signal of the sensor .
Receive messages from other programs or threads.
…
Event-driven programming model is mainly used in applications that focus on making
the processor responds to the user's manipulation.
3
handlers an example of some are the keys in your keyboard when the letter
"t" is clicked wile in word document it sends a signal to input that letter, also
the "Ctrl + Alt + Del" buttons are clicked together it sends a signal to start up
task manager on your system. Also mouse movements trigger a software
routine that processes its actions to what the curse is doing on the display.
Trigger Function:
Trigger functions in event driven programming are mechanisms that
decide what code to run when a specific event occurs, trigger functions are
used to select which event handler to use for the specific event that has
occurred. Many devices have trigger functions with a specific event that runs
for it.
Event:
o Event is the key. Logic of program is represented by events.
o Programmer select event that is useful for program to implement
(not all).
Mouse event:
Moving a mouse in certain directions causing cursor to respond to the
movements on the display. Scroll button up down and click. Left button click,
right button click, double click. All these triggers have a specific event tied to
them.
Procedural programming means that you define a program and its subprograms as a
series of steps. In contrast, declarative programs try to describe the result without
regard to the steps taken to computer it but rather some description or denotation
of the desired result.
Procedural programming is you define a program and its sub subprograms as a series
of step
Event based programming is about writing event handling procedures and having the
core event loop provided by the underlying system. In this way you can save the
trouble of writing your own event loop and benefit from various libraries that
already work with the system provided event loop. Event based programs are very
often writing using object-oriented style, but not always.
4
Therefore, there are not actually a relationship between procedural, object-oriented
and event-driven programming. Based on the problem, you pick the most efficiency
paradigm to solve the problem.
5
App:
Add:
When we enter 1, the program will allow us to add new data(phone) including phone’s
name, phone’s brand, phone’s quantity and phone’s price.
6
View:
When we enter 2, the program will show us all the phone that we have added.
Statistic:
When we enter3, the program will show the statistic of all the the phone.
7
Search:
Implementation:
Phone.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PhoneStore
class Phone
public Phone() { }
8
{
this.name = name;
this.brand = brand;
this.quantity = quantity;
this.price = price;
Managephone.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
9
using System.Threading.Tasks;
namespace PhoneStore
class ManagePhone
public ManagePhone()
int choice;
do
Console.Clear();
Console.WriteLine("======MENU=======");
Console.WriteLine("3.Statistic");
Console.WriteLine("4. Search");
Console.WriteLine("5. Exit");
Console.WriteLine("-----------------");
Console.WriteLine("Please choose:");
choice = int.Parse(Console.ReadLine());
switch (choice)
Console.ReadKey();
//Add Function
10
{
Console.Write("Enter brand:");
Console.Write("Enter quantity:");
Console.Write("Enter price:");
//View Function
//Show Statistic
int quan = 0;
double revenue = 0;
11
//Search Function
int choice;
Console.WriteLine("--------------------");
Console.WriteLine("Choose funtion:");
choice = int.Parse(Console.ReadLine());
switch (choice)
case 1:
String n = Console.ReadLine();
if (result != null)
else
Console.WriteLine("Not found");
break;
case 2:
String m = Console.ReadLine();
break;
12
}
Program.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PhoneStore
class Program
P4 Explain the debugging process and explain the debugging facilities available in the IDE.
Definition:
Debugging is the process of detecting and removing of existing and potential errors
(also called as ‘bugs’) in a software code that can cause it to behave unexpectedly or crash.
To prevent incorrect operation of a software or system, debugging is used to find and
resolve bugs or defects. When various subsystems or modules are tightly coupled,
debugging becomes harder as any change in one module may cause more bugs to appear in
another. Sometimes it takes more time to debug a program than to code it.
Here’s the debugging process:
Reproduce the problem.
Describe the bug. Try to get as much input from the user to get the exact reason.
13
Capture the program snapshot when the bug appears. Try to get all the variable values
and states of the program at that time.
Analyse the snapshot based on the state and action. Based on that try to find the cause
of the bug.
Fix the existing bug, but also check that any new bug does not occur.
Example:
14
P5. Outline the coding standard you have used in your code.
Here are some coding standard that I have used in my code.
-Line indentation and spacing:
-Written to a tab for the commands located in the command block {}.
Uppercase:
All characters in the identifier must be capitalized. Use this rule to have the designation
from 2 characters back down.
15
Reference
https://economictimes.indiatimes.com/definition/debugging
https://link.springer.com/chapter/10.1007/978-3-642-13244-5_34
https://www.quora.com/How-does-IDE-help-in-the-debugging-procedure
https://stackoverflow.com/questions/426569/why-is-debugging-better-in-an-
ide
https://www.geeksforgeeks.org/coding-standards-and-guidelines/
16