Professional Documents
Culture Documents
1618 - Assignment 2 Full
1618 - Assignment 2 Full
Unit 1: Programming
ASSIGNMENT 2
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
❒ Summative Feedback: ❒ Resubmission Feedback:
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 Tutor.
● The form of submission will be a soft copy posted on http://cms.greenwich.edu.vn/.
● Remember to convert the word file into PDF file before the submission on CMS.
Note:
● The individual Assignment must be your own work, and not copied by or from another student.
● 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 understand and follow the guidelines to avoid plagiarism. Failure to comply this
requirement will result in a failed assignment.
LO2 Explain the characteristics of procedural, object-oriented and event-driven programming, conduct an
analysis of a suitable Integrated Development Environment (IDE)
Assignment scenario
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.
Case Studies
You can choose one of following case studies to implement
This system involves the scheduling of flights, air ticket reservations, flight cancellations, customer support,
and staff management. Daily flights updates can also be retrieved by using the system.
1. Customers should be able to search for flights for a given date and source/destination airport.
2. Customers should be able to reserve a ticket for any scheduled flight. Customers can also build a multi-
flight itinerary.
3. Users of the system can check flight schedules, their departure time, available seats, arrival time, and
other flight details.
4. The admin of the system can add new aircrafts, flights, and flight schedules. Admin can cancel any pre-
scheduled flight (all stakeholders will be notified).
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 Analyse the common features D2 Critically evaluate the source
procedural, object-oriented and that a developer has access to in code of an application which
event-driven paradigms are; an IDE. implements the programming
their characteristics and the paradigms, in terms of the code
relationship between them. structure and characteristics.
P3 Write a program that M3 Use the IDE to manage the D3 Evaluate the use of an IDE
implements an algorithm using development process of the for development of applications
an IDE. program. contrasted with not using an
IDE.
LO4 Determine the debugging process and explain the importance of a coding standard
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 in develop more secure, robust a team as well as for the
the IDE. applications. individual.
P5 Outline the coding standard
you have used in your code.
Table of Contents
Table of Contents
Unit 1: Programming ASSIGNMENT 2......................................................................................................................1
Assignment Brief 2 (RQF)......................................................................................................................................3
Higher National Certificate/Diploma in Computing............................................................................................3
LO2 Explain the characteristics of procedural, object-oriented and event-driven programming, conduct an
analysis of a suitable Integrated Development Environment (IDE).........................................................................1
P2 Give explanations of what procedural, object-oriented and event-driven paradigms are; their
characteristics and the relationship between them............................................................................................1
1.Procedural paradigms..................................................................................................................................1
2. Object-oriented paradigms..........................................................................................................................2
3. Event – driven paradigm..............................................................................................................................6
4.Relationship between Procedual, Object – oriented and Event – driven paradigms....................................8
LO3 Implement basic algorithms in code using an IDE............................................................................................9
P3 Write a program that implements an algorithm using an IDE........................................................................9
1.Use case.......................................................................................................................................................9
2.Code:............................................................................................................................................................9
3.Application Screenshots:............................................................................................................................21
LO4 Determine the debugging process and explain the importance of a coding standard...................................24
P4 Explain the debugging process and explain the debugging facilities available in the IDE.............................24
P5 Outline the coding standard you have used in your code............................................................................26
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.
1.Procedural paradigms
1.1. Definition
- It's a programming paradigm evolved from structured programming that focuses on increasing the
computer program's clarity, quality, and development time. Imperative programming is another name
for it. It is based on the procedure call idea. Procedures are also known as routines, subroutines, and
functions. It also adheres to the functional programming paradigm, which aids in the repair of code
and increases its reusability.
Page |1
1.2. Characteristics
The essential characteristics of Procedural programming are listed below:
A big program is decomposed into smaller, more manageable processes or functions. This
minimizes code duplication, making the code more readable and maintainable.
Global variables allow different functions to exchange data. Because functions are entirely
separated, we must declare data in the higher scope if we wish to share it.
Global data can be changed by functions. Because global data is passed from function to
function, global data in function chains may be changed throughout the transformation.
Methodology from the top down. As previously said, procedural programming employs a top-
down approach, with workflow moving from top to bottom.
2. Object-oriented paradigms
2.1. Definition
- Object-oriented programming (OOP) is a programming paradigm that organizes software design
around data, rather than functions and logic. An object is a data field with its own set of characteristics
and behavior. Object-oriented programming (OOP) focuses on the objects that developers wish to
control rather than the logic that is necessary to manipulate them. This kind of programming is best
suited to big, complicated, and often updated or maintained applications. This covers manufacturing
and design software, as well as mobile apps; for example, OOP may be used to simulate
manufacturing systems.
Page |2
An example of Object-oriented programming in C++ :
2.2. Characteristics
Page |3
2.2.2. Inheritance
- Through inheritance, this attribute allows an object to inherit properties from another object. This makes it
possible for objects to share or expand existing properties without having to rewrite them. This trait, however,
is not shared by all object-oriented languages.
2.2.3. Encapsulation
- Encapsulation is the process or method of combining code and the data it manipulates into a single
entity. Encapsulation adds a layer of protection to altered data, keeping it safe from outside tampering
and misuse. Classes and objects in Java help with this.
Page |4
2.2.4. Abstraction
- Abstraction is a notion that allows you to extract the most important information from an item.
Abstraction aids the simple incorporation of real-world items into software programs in OOP (Object
Oriented Programming). Abstraction simplifies the understanding of real-world things by removing the
object's superfluous characteristics.
2.2.5. Polymorphisms
- Polymorphic comes from the Greek word polymorphosis, which meaning "multiple forms." Object-
oriented programming uses Poly' Many, Morphos' forms. Polymorphism refers to the fact that it exists
in several forms. Polymorphism allows data types and/or data classes to handle an object differently.
It is, more exactly, the capacity of several things to respond to the same message in various ways. It
enables the ability to rede'ne a method within a derived class and allows a same name or operator to
be associated with multiple actions based on the type of data it has provided.
Page |5
3. Event – driven paradigm
- Event-driven programming is a programming paradigm in which events, such as a user action such as
a mouse click or key press, or a message from the operating system or another program, govern the
flow of program execution. An event-driven application is one that detects events as they happen and
responds with an appropriate event-handling technique. The concept is based on interrupt-driven
programming, which was popular in early command-line environments like DOS and embedded
computers (where the application is implemented as firmware).
Example:
Page |6
3.1. Characteristics
Service-Oriented: The feature of service-focused programming, which is used to design
programs for services, is that it does not slow down the computer. The service-oriented model
consumes a small portion of the computer's control power, and services often run in the
background of the operating system.
Trigger Functions: In event-driven coding, trigger functions are functions that decide what
code to run when a given event happens. When a certain event occurs, programmers utilize
these functions to choose the event handler to employ for the function.
Events: The mouse, computer keyboard, and user interface are examples of events that must
be triggered in this software. This implies the user must interact with some item in the
software, such as clicking a button with a mouse, selecting a button with the computer
keyboard, and so on.
- A procedural paradigm is a way of thinking about how to solve an issue. I start with a, then b, and
finally c. There is a clear mechanism in place, and the data flow is quite predictable.
- Looking at the actors and building objects to represent them is what object oriented design is all
about. An emulator for a movie line queue, for example. People, a queue, and a ticket counter are all
there. As a result, you create objects based on the actors.
- When you have a spontaneous situation that has to be handled, event driven is the way to go. Both
procedural and object-oriented paradigms can have event handlers. As a result, it isn't a
comprehensive paradigm on its own. For example, your procedural report writer may be dealing with
an event that has run out of paper. Alternatively, the object-oriented application may contain an event
to manage when lightning strikes a moviegoer in line. Events are more of a complement to other
features.
Page |8
LO3 Implement basic algorithms in code using an IDE
1.Use case
Explanation:
The Reader will have the function : Search Book, Borrow Book, Return Book.
The Libraian will have the function : Search Book, Management Readers, Management Book,
Management Borrow and Return Book.
2.Code:
public class Book
{
public int Code { get; set; }
public string Title { get; set; }
public string Publisher { get; set; }
public string Edition { get; set; }
public string Author { get; set; }
public string Category { get; set; }
public string Photo { get; set; }
}
Page |9
public partial class Book : Form
public Book()
InitializeComponent();
InitData();
LoadData();
LockControls(false);
LockButtons(true);
BookData.Add(new Book
Code = 111,
Edition = "V3.3",
Category ="Computer",
Photo = "book01.jpg"
});
BookData.Add(new Book
P a g e | 10
Code = 222,
Edition = "V1.1",
Category = "Literature",
Photo = "book02.jpg"
});
BookData.Add(new Book
Code = 333,
Edition = "V1.2",
Category = "Music",
Photo = "book03.jpg"
});
BookData.Add(new Book
Code = 444,
Edition = "V2.2",
Category = "Science",
Photo = "book04.jpg"
});
BookData.Add(new Book
Code = 555,
P a g e | 11
Title = "Tuổi Trẻ Đáng giá bao nhiêu?",
Edition = "V3.2",
Category = "Literature",
Photo = "book05.jpg"
});
BookData.Add(new Book
Code = 666,
Edition = "V2.3",
Category = "Children",
Photo = "book06.jpg"
});
BookData.Add(new Book
Code = 777,
Edition = "V2.3",
Category = "Chemistry",
Photo = "book07.jpg"
});
BookData.Add(new Book
Code = 888,
Edition = "V2.3",
Category = "Cooking",
Photo = "book08.jpg"
});
BookData.Add(new Book
Code = 999,
Edition = "V2.3",
Category = "Novel",
Photo = "book09.jpg"
});
BookData.Add(new Book
Code = 1000,
Edition = "V2.3",
Category = "Economy",
Photo = "book10.jpg"
});
BookData.Add(new Book
Code = 1001,
Author = "Herodotus",
Category = "History",
Photo = "book11.jpg"
});
return BookData;
dataGVBooks.DataSource = GetBookData();
txtCode.Text = dataGVBooks.CurrentRow.Cells[0].Value.ToString();
txtTitle.Text = dataGVBooks.CurrentRow.Cells[1].Value.ToString();
txtPublisher.Text = dataGVBooks.CurrentRow.Cells[2].Value.ToString();
txtEdition.Text = dataGVBooks.CurrentRow.Cells[3].Value.ToString();
txtAuthor.Text = dataGVBooks.CurrentRow.Cells[4].Value.ToString();
cbCategory.SelectedItem = dataGVBooks.CurrentRow.Cells[5].Value.ToString();
txtPhoto.Text = dataGVBooks.CurrentRow.Cells[6].Value.ToString();
//show photo
picPhoto.SizeMode = PictureBoxSizeMode.StretchImage;
P a g e | 14
}
txtCode.Enabled = locked;
txtTitle.Enabled = locked;
txtPublisher.Enabled = locked;
txtEdition.Enabled = locked;
txtAuthor.Enabled = locked;
cbCategory.Enabled = locked;
txtPhoto.Enabled = locked;
btnAddNew.Enabled = locked;
btnDelete.Enabled = locked;
btnUpdate.Enabled = locked;
btnSave.Enabled = !locked;
btnCancel.Enabled = !locked;
txtCode.Text = "";
txtTitle.Text = "";
txtPublisher.Text = "";
txtEdition.Text = "";
txtAuthor.Text = "";
cbCategory.SelectedIndex = 0;
txtPhoto.Text = "";
LockControls(true);
txtCode.Focus();
LockButtons(false);
ClearInput();
save = "add";
LockControls(true);
LockButtons(true);
ClearInput();
b.Code = int.Parse(txtCode.Text);
b.Title = txtTitle.Text;
b.Publisher = txtPublisher.Text;
b.Edition = txtEdition.Text;
b.Author = txtAuthor.Text;
b.Category = cbCategory.SelectedItem.ToString();
BookData.Add(b);
b.Photo = txtPhoto.Text;
dataGVBooks.DataSource = null;
dataGVBooks.DataSource = GetBookData();
LockControls(false);
LockButtons(true);
}
P a g e | 16
private void UpdateProcess()
book.Title = txtTitle.Text;
book.Publisher = txtPublisher.Text;
book.Edition = txtEdition.Text;
book.Author = txtAuthor.Text;
book.Category = cbCategory.SelectedItem.ToString();
book.Photo = txtPhoto.Text;
dataGVBooks.DataSource = null;
dataGVBooks.DataSource = GetBookData();
LockControls(false);
LockButtons(true);
BookData.Remove(book);
dataGVBooks.DataSource = null;
dataGVBooks.DataSource = GetBookData();
LockControls(false);
LockButtons(true);
ClearInput();
{
P a g e | 17
switch(save)
case "add":
AddNewProcess();
break;
case "update":
UpdateProcess();
break;
if(txtCode.Text != "")
if (result == DialogResult.Yes)
DeleteProcess();
if (txtCode.Text != "")
LockControls(true);
P a g e | 18
txtCode.Enabled= false;
txtTitle.Focus();
LockButtons(false);
save = "update";
dataGVBooks.DataSource = null;
dataGVBooks.DataSource = books.ToList();
dataGVBooks.DataSource = null;
dataGVBooks.DataSource = books.ToList();
dataGVBooks.DataSource = null;
dataGVBooks.DataSource = books.ToList();
P a g e | 19
}
dataGVBooks.DataSource = null;
dataGVBooks.DataSource = books.ToList();
LockControls(false);
switch(criteria)
case 0:
SearchByCode();
break;
case 1:
SearchByTitle();
break;
case 2:
SearchByAuthor();
break;
case 3:
SearchByPublisher();
break;
P a g e | 20
private void cbSearch_SelectedIndexChanged(object sender, EventArgs e)
LockControls(true);
ClearInput();
3.Application Screenshots:
P a g e | 21
P a g e | 22
P a g e | 23
LO4 Determine the debugging process and explain the importance of a coding standard
P4 Explain the debugging process and explain the debugging facilities available in the IDE.
1. What is Debug?
- During the development phase, software programs are subjected to extensive testing, upgrading,
debugging, and maintenance. Typically, software contains flaws and faults, which are eliminated on a
regular basis. Debugging is the process of repairing a software issue. It refers to the process of
locating, evaluating, and correcting problems. This procedure starts when the program fails to run
correctly and ends with the problem being resolved and the software being successfully tested.
However, because problems must be corrected at all levels of debugging, it is regarded a very difficult
and time-consuming operation.
Identify Error
- Early detection of problems can help you save a lot of time. We waste a lot of time if we make a
mistake when detecting an issue. It's difficult to track down errors or defects that arise on a
customer's site. To save time and avoid problems at the user site, it's critical to identify the correct
error.
P a g e | 24
- Following the identification of an issue, we must locate the specific spot in the code where the
problem occurred. Identifying the specific spot where the mistake occurs might assist in resolving the
issue more quickly.
Analyze Error
- You must use an appropriate technique to examine the mistake at this step. This will assist you in
comprehending the issue. This stage is crucial since correcting one error may result in the occurrence
of another.
- After you've studied the detected issue, you'll need to focus on additional software faults. This
procedure entails test automation, in which you must develop test cases using a test framework.
- You must unit test all of the code where the changes are made at this step. If all test cases pass the
test, you can go to the next stage; otherwise, you must resolve the test case that failed. Correct and
validate: this is the final stage of debugging, when you must fix all errors and test all test scripts.
P a g e | 25
P5 Outline the coding standard you have used in your code.
1.Coding standard and Naming convension
- They are a set of processes that may be specified for a certain programming language, including a
programming style, methods, and procedures. These procedures can cover a wide range of
characteristics of a program built in that language. They can be thought of as necessary characteristics
of software development. A coding standard ensures that all developers working on a project adhere
to the same set of principles. The code is simple to understand and maintains sufficient consistency.
A coding standard offers the programs created by various engineers a consistent look.
It increases the code's readability and maintainability while simultaneously reducing its complexity.
- Before delving into the specifics of the coding standards, it's crucial to understand the significance that naming
conventions play in developing code, independent of the platform on which you're working. Finally, naming
standards, whether for classes, functions, variables, attributes, or arguments, should aid in the explanation of
the reason for which they are used.
Object Name Notation Length Plural Prefix Suffix Abbreviation Char Mask Underscores
P a g e | 26
Local variables camelCase 50 Yes No No Yes [A-z][0-9] No
P a g e | 27
2. Apply coding standard in my code
I applied coding standards and naming convension in P3 section 2 above
P a g e | 28
P a g e | 29
REFERENCES
Codelearn.io. 2021. Tất Tần Tật Về Lập Trình Hướng Đối Tượng? (Phần 1). [online] Available at:
<https://codelearn.io/sharing/tat-tan-tat-ve-lap-trinh-huong-doi-tuong-phan-1> [Accessed 25
October 2021].
Quora. 2021. What are the relationships between programming procedural, object-oriented and
event-driven paradigms?. [online] Available at: <https://www.quora.com/What-are-the-
relationships-between-programming-procedural-object-oriented-and-event-driven-paradigms>
[Accessed 28 October 2021].
Edureka. 2021. What is Debugging? Different Stages of Debugging | Edureka. [online] Available at:
<https://www.edureka.co/blog/what-is-debugging/> [Accessed 29 October 2021].
P a g e | 30
Multidots. 2021. Importance of Code Quality and Coding Standard in Software Development. [online]
Available at: <https://www.multidots.com/importance-of-code-quality-and-coding-standard-in-
software-development/> [Accessed 1 November 2021].
McFarlin, T., 2021. WordPress Coding Standards: Naming Conventions & Function Arguments. [online]
Code Envato Tuts+. Available at: <https://code.tutsplus.com/articles/wordpress-coding-standards-
naming-conventions-function-arguments--wp-31683> [Accessed 1 November 2021].
P a g e | 31