Professional Documents
Culture Documents
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: GCS0903
ID: GCS200547
Assignment due:
Assignment submitted:
ASSIGNMENT 2 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing
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
P a g e 2 | 25
ASSIGNMENT 2 BRIEF
Qualification BTEC Level 5 HND Diploma in Computing
Academic Year
Unit Tutor
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
P a g e 3 | 25
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.
P3 Write a program that M3 Use the IDE to manage D3 Evaluate the use of an
implements an algorithm the development process of IDE for development of
using an IDE. the program. applications contrasted
with not using an IDE.
P a g e 4 | 25
available in the IDE. used to help develop more necessary in a team as well
secure, robust applications. as for the individual.
P5 Outline the coding
standard you have used
in your code.
Contents
Programming ........................................................................................................................ 1
ASSIGNMENT ...................................................................................................................... 1
I. Explanation ........................................................................................................................ 6
1. Definition ....................................................................................................................... 6
1.1. What are procedural, object-oriented and event-driven paradigms? ........................ 6
1.2. Their characteristics and the relationship between them ......................................... 7
1.3. What is Integrated Development Environment (IDE)? ............................................. 8
2. Explain .......................................................................................................................... 9
II. Analysis .......................................................................................................................... 10
1. Conduct an analysis of a suitable Integrated Development Environment (IDE) ............ 10
2. Outline the coding standard you have used in your code. ............................................ 10
3. Analyse the common features that a developer has access to in an IDE. .................... 10
4. Determine the debugging process and explain the importance of a coding standard ... 10
III. Implement ...................................................................................................................... 10
1. Write a program that implements an algorithm using an IDE. ...................................... 10
2. Implement basic algorithms in code using an IDE........................................................ 10
3. Use the IDE to manage the development process of the program. .............................. 10
IV. Evaluation ...................................................................................................................... 22
1. Critically evaluate the source code of an application which implements the programming
paradigms, in terms of the code structure and characteristics. ........................................ 23
2. Evaluate how the debugging process can be used to help develop more secure, robust
applications. .................................................................................................................... 23
3. Evaluate the use of an IDE for development of applications contrasted with not using an
IDE. ................................................................................................................................. 23
4. Critically evaluate why a coding standard is necessary in a team as well as for the
individual. ........................................................................................................................ 23
V. Reference ....................................................................................................................... 23
P a g e 5 | 25
I. Explanation
1. Definition
1.1. What are procedural, object-oriented and event-driven paradigms?
Procedural programming: a list of instructions telling a computer, step-by-
step, what to do, in an order of how to performance the first code to the
second and so forth which may contain loops. For example: C, C++, Fortran,
Pascal,… these are very detailed and takes a lot of time to write
P a g e 6 | 25
A simple event-driven programming paradigm
P a g e 7 | 25
➢ Compare Event Driven Programming with Object-oriented Programming
(OOP)
Object oriented is looking at the actors and creating objects to represent those
actors. For example, an emulator for a movie line queue. You’ve got people,
the line, and a ticket booth. So, you build objects around those actors.
Event driven, is used when you have spontaneous moments that need to be
taken care of. You can add event handlers to both procedural and object
oriented paradigms. So, as a stand alone, it’s not a complete paradigm. For
instance your procedural report writer could have an event to handle out of
paper. Or the object oriented program could have an event to handle when
lightning hits a person standing line for the movie. Events are more a feature
to add to other stuff.
❖ By the number of languages supported, the IDE widely used today can be
divided into two categories:
➢ Single-language unified development environment: work with a specific
language, e.g. Microsoft Visual Basic 6.0 IDE.
➢ Multi-language unified development environment: can work with many
programming languages, e.g. Eclipse IDE, NetBeans, Microsoft Visual
Studio.
2. Explain: the debugging process and debugging facilities available in the IDE.
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.
Debugging Tools:
➢ Code highlighting: When an IDE detects an syntax error, it will often help
you by highlighting the section of code where it has detected the error.
P a g e 9 | 25
Tip: if you see code highlighted, check the previous line of code for an
error.
II. Analysis
1. Conduct an analysis of a suitable Integrated Development Environment (IDE)
2. Outline the coding standard you have used in your code.
3. Analyse the common features that a developer has access to in an IDE.
4. Determine the debugging process and explain the importance of a coding
standard
III. Implement
1. Write a program that implements an algorithm using an IDE.
2. Implement basic algorithms in code using an IDE
3. Use the IDE to manage the development process of the program.
P a g e 10 | 25
Class Program:
using System;
namespace testAs
{
class Program
{
static void Main(string[] args)
{
MainMenu a = new MainMenu();
Console.ReadKey();
}
}
}
Class Check:
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
namespace testAs
{
class Check
{
}
public static bool checkLecId(String str)
{
if ((str.Length == 8) && (Int32.TryParse(str, out _)))
return true;
else return false;
}
public static bool IsValidEmail(String mail)
{
string a = "@";
string c = " ";
if (mail.Contains(a))
{
if (mail.Count(b => b == '@') == 1)
{
if (mail.Substring(0, 1) != a)
P a g e 11 | 25
{
if (mail.Substring(mail.Length - 1) != a)
{
if (mail.Contains(c) == false)
{
return true;
}
}
}
}
}
return false;
}
}
}
Class MainMenu:
namespace testAs
{
class MainMenu
{
public MainMenu()
{
int choice;
do
{
Console.Clear();
Console.WriteLine("=========MENU==========");
Console.WriteLine("1.Manage Student");
Console.WriteLine("2.Manage Lecture");
Console.WriteLine("3.Exit");
Console.WriteLine("--------------------");
Console.Write("Choose funtion:");
choice = int.Parse(Console.ReadLine());
switch (choice)
{
case 1:
MenuStudent a = new MenuStudent();
break;
case 2:
MenuLecture b = new MenuLecture();
break;
case 3: break;
default:
Console.WriteLine("Invalid");
break;
}
} while (choice != 3);
}
}
}
Class MenuStudent:
using System;
using System.Collections.Generic;
using System.Text;
P a g e 12 | 25
namespace testAs
{
class MenuStudent
{
public MenuStudent()
{
int choice;
ManageStudent a = new ManageStudent();
do
{
Console.Clear();
Console.WriteLine("List View");
a.View();
Console.WriteLine("--------------Menu-----------------");
Console.WriteLine("1. Add Student");
Console.WriteLine("2. View Student");
Console.WriteLine("3. Delete Student");
Console.WriteLine("4. Search Student");
Console.WriteLine("5. Update");
Console.WriteLine("6. Back to menu");
Console.WriteLine("-------------------------------------");
Console.Write("Choose the funciton: ");
choice = int.Parse(Console.ReadLine());
switch (choice)
{
case 1:
a.Add();
break;
case 2:
a.View();
break;
case 3:
a.Delete();
break;
case 4:
a.Find();
break;
case 5:
a.Update();
break;
case 6:
break;
default:
Console.WriteLine("invalid choice");
break;
}
Console.ReadKey();
} while (choice != 6);
}
}
}
Class MenuLecture:
using System;
using System.Collections.Generic;
using System.Text;
P a g e 13 | 25
namespace testAs
{
class MenuLecture
{
public MenuLecture()
{
int choice;
ManageLecture a = new ManageLecture();
do
{
Console.Clear();
Console.WriteLine("List view");
a.View();
Console.WriteLine("--------------Menu-----------------");
Console.WriteLine("1. Add Lecture");
Console.WriteLine("2. View Lecture");
Console.WriteLine("3. Delete Lecture");
Console.WriteLine("4. Search");
Console.WriteLine("5. Update");
Console.WriteLine("6. Back to Mainmenu");
Console.WriteLine("-------------------------------------");
Console.Write("Choose the funciton: ");
choice = int.Parse(Console.ReadLine());
switch (choice)
{
case 1:
a.Add();
break;
case 2:
a.View();
break;
case 3:
a.Delete();
break;
case 4:
a.Find();
break;
case 5:
a.Update();
break;
case 6:
break;
default:
Console.WriteLine("invalid choice");
break;
}
Console.ReadKey();
} while (choice != 6);
}
}
}
Class Student:
using System;
using System.Collections.Generic;
using System.Text;
namespace testAs
P a g e 14 | 25
{
class Student
{
private string id;
private string name;
private int age;
private String date;
private string mail;
private string address;
private string batch;
public Student(string id, string name, int age, String date, string mail,
string address, string batch)
{
this.id = id;
this.name = name;
this.age = age;
this.date = date;
this.mail = mail;
this.address = address;
this.batch = batch;
}
public string Id
{
get { return id; }
set { id = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
public int Age
{
get { return age; }
set { age = value; }
}
public string Date
{
get { return date; }
set { date = value; }
}
public string Mail
{
get { return mail; }
set { mail = value; }
}
public string Batch
{
get { return batch; }
set { batch = value; }
}
public string Address
{
get { return address; }
set { address = value; }
}
public void View()
{
P a g e 15 | 25
Console.Write(" {0} | ", Age);
Console.Write(" {0} | ", Date);
Console.Write(" {0} |", Mail);
Console.Write(" {0} |", Address);
Console.WriteLine(" {0}", batch);
}
}
}
Class ManageStudent:
using System;
using System.Collections.Generic;
using System.Text;
namespace testAs
{
class ManageStudent
{
List<Student> list = new List<Student>();
//Add Student
public void Add()
{
string id;
do
{
Console.Write("Input ID (GBSxxxxxx or GCSxxxxxx) : ");
id = Console.ReadLine();
Student st = list.Find(Student => Student.Id == id);
while (st != null)
{
Console.Write("input id (GBSxxxxxx or GCSxxxxxx) : ");
id = Console.ReadLine();
Student sts = list.Find(Student => Student.Id == id);
if (sts == null)
{
break;
}
}
}
while (!Check.checkStuID(id));
string mail;
do
P a g e 16 | 25
{
Console.Write("Enter Student email: ");
mail = Console.ReadLine();
if (!Check.IsValidEmail(mail))
Console.WriteLine("Email is not valid");
}
while (!Check.IsValidEmail(mail));
// Find Stdudent
public void Find()
{
//Delete Stdudent
public void Delete()
{
Console.WriteLine("Input ID: ");
string id;
id = Console.ReadLine();
for (int i = 0; i < list.Count; i++)
P a g e 17 | 25
{
if (id == list[i].Id)
{
list.RemoveAt(i);
}
}
}
// Update Stdudent
public void Update()
{
Console.WriteLine("Input ID (GBSxxxxxx or GCSxxxxxx) : ");
string id;
id = Console.ReadLine();
Student st = list.Find(student => student.Id == id);
for (int i = 0; i < list.Count; i++)
{
if (id == list[i].Id)
{
Console.Write("Enter name: ");
String Name = Console.ReadLine();
st.Name = Name;
int Age;
do
{
Console.Write("Enter Student Age: ");
Age = int.Parse(Console.ReadLine());
}
while (!Check.checkage(Age));
st.Age = Age;
st.Mail = mail;
P a g e 18 | 25
Class Lecture:
using System;
using System.Collections.Generic;
using System.Text;
namespace testAs
{
class Lecture
{
private string id;
private string name;
private int age;
private string date;
private string mail;
private string address;
private string dept;
public Lecture(string id, string name, int age, string date, string mail,
string address, string dept)
{
this.id = id;
this.name = name;
this.age = age;
this.mail = mail;
this.address = address;
this.dept = dept;
}
public string Id
{
get { return id; }
set { id = value; }
}
public string Name
{
get { return name; }
set { name = value; }
}
public int Age
{
get { return age; }
set { age = value; }
}
public string Mail
{
get { return mail; }
set { mail = value; }
}
public string Address
{
get { return address; }
set { address = value; }
}
public string Dept
{
get { return dept; }
set { dept = value; }
}
public string Date
{
get { return date; }
set { date = value; }
}
P a g e 19 | 25
public void View()
{
Console.Write(" {0} | ", Id);
Console.Write(" {0} | ", Name);
Console.Write(" {0} | ", Age);
Console.Write("{0} /", Date);
Console.Write(" {0} ", Mail);
Console.Write(" {0} ", Address);
Console.WriteLine(" {0}", Dept);
}
}
}
Class ManageLecture:
using System;
using System.Collections.Generic;
using System.Text;
namespace testAs
{
class ManageLecture
{
List<Lecture> list = new List<Lecture>();
//Add lecture
public void Add()
{
String id;
do
{
Console.Write("Enter Lecture Id(8 digit): ");
id = Console.ReadLine();
Lecture st = list.Find(Lecture => Lecture.Id == id);
while (st != null)
{
Console.Write("Enter Lecture Id(8 digit): ");
id = Console.ReadLine();
Lecture sts = list.Find(Lecture => Lecture.Id == id);
if (sts == null)
{
break;
}
}
}
while (!Check.checkLecId(id));
string mail;
P a g e 20 | 25
do
{
Console.Write("Enter Lecture email: ");
mail = Console.ReadLine();
if (!Check.IsValidEmail(mail))
Console.WriteLine("Email is not valid");
}
while (!Check.IsValidEmail(mail));
// View Lecture
public void View()
{
foreach (Lecture st in list)
{
Console.Write("{0} /", st.Id);
Console.Write("{0} /", st.Name);
Console.Write("{0} /", st.Age);
Console.Write("{0} /", st.Date);
Console.Write("{0} /", st.Mail);
Console.Write("{0} /", st.Address);
Console.WriteLine("{0}", st.Dept);
}
}
//Find Lecture
public void Find()
{
Console.WriteLine("input: ");
string id;
id = Console.ReadLine();
for (int i = 0; i < list.Count; i++)
{
if (id == list[i].Id)
{
list[i].View();
}
else Console.WriteLine("Not Found");
}
}
public void size()
{
Console.WriteLine("size: {0} ", list.Count);
}
// Delete Lecture
public void Delete()
{
Console.WriteLine("Input ID: ");
string id;
id = Console.ReadLine();
for (int i = 0; i < list.Count; i++)
P a g e 21 | 25
{
if (id == list[i].Id)
{
list.RemoveAt(i);
}
}
}
//Update Lecture
public void Update()
{
Console.WriteLine("Input ID: ");
string id;
id = Console.ReadLine();
Lecture st = list.Find(Lecture => Lecture.Id == id);
for (int i = 0; i < list.Count; i++)
{
if (id == list[i].Id)
{
Console.Write("Enter Name: ");
String name = Console.ReadLine();
st.Name = name;
int age;
do
{
Console.Write("Enter Lecture Age: ");
age = int.Parse(Console.ReadLine());
}
while (!Check.checkage(age));
st.Age = age;
Console.Write("Enter Address: ");
String date = Console.ReadLine();
st.Date = date;
string mail;
do
{
Console.Write("Enter email: ");
mail = Console.ReadLine();
if (!Check.IsValidEmail(mail))
Console.WriteLine("Email is not valid");
}
while (!Check.IsValidEmail(mail));
st.Mail = mail;
Console.Write("Enter Address: ");
String address = Console.ReadLine();
st.Address = address;
Console.Write("Enter Dept: ");
String dept = Console.ReadLine();
st.Dept = dept;
}
else
Console.WriteLine("Not found");
}
}
}
}
IV. Evaluation
P a g e 22 | 25
1. Critically evaluate the source code of an application which implements the
programming paradigms, in terms of the code structure and characteristics.
2. Evaluate how the debugging process can be used to help develop more secure,
robust applications.
3. Evaluate the use of an IDE for development of applications contrasted with not
using an IDE.
4. Critically evaluate why a coding standard is necessary in a team as well as for the
individual.
V. Reference
Tuan Nguyen's Blog. 2021. Programming paradigms - what is procedural
programming? https://www.tuannguyen.tech/2019/05/programming-paradigms-what-
is-procedural-programming/.
Hackr.io. 2021. What is Procedural Programming? [Definition] - Key Features.
https://hackr.io/blog/procedural-programming.
The Economic Times. 2021. What is Debugging? Definition of Debugging,
Debugging Meaning - The Economic Times.
https://economictimes.indiatimes.com/definition/debugging
TeachAllAboutIT | Computer Science Tuition, Resources, & Live Lessons. 2021.
Common Tools & Facilities of an IDE | TeachAllAboutIT.
https://teachallaboutit.school/common-tools-facilities-of-an-ide/.
prezi.com. 2021. Procedural, object oriented and event driven programming
paradigms by Zubair Dadabhai:
https://prezi.com/xbpqj5wekzgf/procedural-object-oriented-and-event-driven-
programming-paradigms/.
Object-oriented programming from
https://sinhvientot.net/lap-trinh-huong-doi-tuong-oop-object-oriented-programming/.
Characteristics of Object Oriented programming language - oops.
https://www.careerride.com/oops-characteristics.aspx.
Wikipedia. 2021. Object-oriented programming – Wikipedia
https://en.wikipedia.org/wiki/Object-oriented_programming.
Event-driven Programming from
https://www.technologyuk.net/computing/software-development/software-
design/event-driven-programming.shtml
Characteristics of event driven programming - Distributed Systems Authority
https://distributedsystemsauthority.com/characteristics-of-event-driven-
programming/.
P a g e 23 | 25
UKEssays.com. 2021. Event-Driven Programming Features.
https://www.ukessays.com/essays/computer-science/eventdriven-programming-
features-6167.php.
P a g e 24 | 25
P a g e 25 | 25