0% found this document useful (0 votes)
114 views62 pages

TungDT BH02089 AssignmentII Programming st2

Uploaded by

phamhieu0977
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views62 pages

TungDT BH02089 AssignmentII Programming st2

Uploaded by

phamhieu0977
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 62

ASSIGNMENT 2

ASSIGNMENT 2 FRONT SHEET

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 Pham Minh Hieu Student ID

Class SE07203 Assessor name TA QUANG HIEU

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 HIEU
Grading grid
P3 P4 P5 P6 M2 M3 M4 D2 D3 D4

1
Grading grid

P3 P4 P5 P6 M2 M3 M4 D2 D3 D4

2
❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:

Lecturer Signature:

1
Table of Contents

LIST OF TABLES OF FIGURES...................................................................................................................2


I. INTRODUCTION...............................................................................................................................3
II. CONTENTS......................................................................................................................................4
1. Explain the characteristics of procedural, object-oriented and event-driven programming.
(LO2)....................................................................................................................................................................................... 4
1.1. Discuss what procedural, object-orientated and event-driven paradigms are; their characteristics and the
relationship between them. (P3)...........................................................................................................................................6
a. Procedural programming system (POP).......................................................................................................................................... 6
b. Object-oriented programming system (OOPs)..........................................................................................................9
c. Event driven programming (EDP)...........................................................................................................................17
d. Relationship between Procedural, Object-oriented, Event-driven..........................................................................21
1.2. Compare the procedural, object-orientated and event-driven paradigms used in given source code of an
application. (M2)................................................................................................................................................................ 24
1.3. Critically evaluate the source code of an application that implements the procedural, object-orientated and
event-driven paradigms, in terms of the code structure and characteristics. (D2).............................................................25

2. Implement basic algorithms in code using an IDE. (LO3).........................................................................25


2.1. Write a program that implements an algorithm using an IDE. (P4)........................................................................26
2.2. Enhance the algorithm written, using the features of the IDE to manage the development process. (M3)..........42

3. Determine the debugging process and explain the importance of a coding standard. (LO4)....................42
3.1. Explain the debugging process and explain the debugging facilities available in the IDE. (P5)..............................42
3.2. Explain the coding standard you have used in your code. (P6).............................................................................47

4. CONCLUSION................................................................................................................................56
5. CRITICAL EVALUATE......................................................................................................................57
6. REFERENTCE.................................................................................................................................58

LIST OF TABLES OF FIGURES


figure 1: Programming.................................................................................................................................................4
figure 2: Programming paradigm................................................................................................................................5
figure 3: Procedural programming(POP).....................................................................................................................6
figure 4: characteristics of POP...................................................................................................................................7

2
figure 5: Source code of POP.......................................................................................................................................9
figure 6: Code run example.........................................................................................................................................9
figure 7: Object oriented programming(OOP).............................................................................................................9
figure 8: Characteristic of OOP..................................................................................................................................10
figure 9: class.............................................................................................................................................................11
figure 10: Objects......................................................................................................................................................11
figure 11: Data abtraction.........................................................................................................................................12
figure 12: Data encapsulation....................................................................................................................................12
figure 13: Polymorphism in OOP...............................................................................................................................13
figure 14: Inheritance................................................................................................................................................14
figure 15: OOP example code...................................................................................................................................16
figure 16: Code run....................................................................................................................................................17
figure 17: Event-driven programming.......................................................................................................................17
figure 18: Source code of login interface and creat an accout..................................................................................21

I. INTRODUCTION.

3
figure 1: Programming

In response to the increasing demand for efficient and secure software solutions, our
research and development team has embarked on a mission to explore the most effective
programming paradigms for developing a water bill calculation application. This report
serves as a comprehensive overview of three key programming paradigms – procedural,
object-oriented, and event-driven programming – as we seek to identify the most
suitable approach for our project.

As we delve into the characteristics, advantages, and disadvantages of each paradigm, our
goal is to lay the groundwork for making informed decisions in the development process.
Beyond theoretical considerations, our team has been entrusted with the challenging task of
creating a fully functional, secure application. This application will be developed using an
Integrated Development Environment (IDE) and will strictly adhere to coding standards,
ensuring both efficiency and adherence to industry best practices.

This introduction sets the stage for our exploration of programming paradigms and
introduces the subsequent analysis of their applicability to our water bill calculation
application. The report not only aims to provide a theoretical understanding but also
outlines the practical challenges that our team will navigate in the pursuit of a robust and
user- friendly software solution.

II. CONTENTS.
1. Explain the characteristics of procedural, object-oriented and event-driven
programming. (LO2)
First, I want to present about programming models to clearly understand why there are
different programming models in the world and how to apply it in practice:

What is programming paradigms?

4
figure 2: Programming paradigm

Programming paradigms are different ways or styles in which a given program or


programming language can be organized. Each paradigm consists of certain
structures, features, and opinions about how common programming problems should
be tackled.

There are some of the most popular programming paradims:

 Imperative programming: This paradigm focuses on how to change the state of


the program using instructions or commands. The programmer specifies the exact
steps that the program should follow to achieve the desired result. Imperative
programming is one of the oldest and most widely used paradigms.
- It is conclude: Object-oriented programming, Procedural programming.
 Procedural programming: This paradigm is a type of imperative programming that
organizes the instructions into procedures or subroutines. Procedures are reusable
blocks of code that can take inputs and return outputs. Procedural programming
aims to make the code more modular, organized, and easy to maintain.
5
- It is conclude: Funtional programming, logic programming

6
Next, I would like to go deeper into each paradigms.

1.1. Discuss what procedural, object-orientated and event-driven


paradigms are; their characteristics and the relationship between them. (P3)
a. Procedural programming system (POP).

figure 3: Procedural programming(POP)

Definition POP: Procedure oriented programming is the conventional way of programming


where an application problem is viewed as a sequence of steps. In procedure oriented
programming the problems is broken down into various modules such as data entry reporting
querying modules etc. The procedure-oriented programming is the traditional approach of
programming for developing application software.

The characteristics of POP:

7
figure 4: characteristics of POP

Some Characteristics exhibited by procedure-oriented programming are:

• Emphasis is on doing things (Algorithms).

• Large programs are divided into smaller programs known as functions.

• Most of the functions share global data.

• Data move openly around the system from function to function.

• Functions transform data from one form to another.

• Employs top-down approach in program design.

Advantages of procedure oriented programming:

Some Characteristics exhibited by procedure-oriented programming are:

• Emphasis is on doing things (Algorithms).

• Large programs are divided into smaller programs known as functions.

8
• Most of the functions share global data.

• Data move openly around the system from function to function.

• Functions transform data from one form to another.

• Employs top-down approach in program design.

Disadvantages of procedure oriented programming:

 It stresses more an algorithm rather than data.


 It takes more time in processing.
 The global data is available to the function so it is easily accessed by any function, which
creates certain problems

Application of procedural programming (POP):

 File management: By using procedures and functions to perform operations such as


reading, opening and closing files, procedural programming can be applied in reading
data and processing files. - Embedded systems: Procedural programming can be used
Procedural programming can be used for hardware control, memory management,
event handling, and other tasks in embedded systems.
 Digital Science: It is used in arithmetic computation, data analysis and simulation.
 Application multitasking: POP allows concurrent tasks to be handled through the
use of processes and threads to manage and control tasks sequentially.

An example of POP:

 Source code:

9
figure 5: Source code of POP
 Code run:

figure 6: Code run example

b. Object-oriented programming system (OOPs).

Definition OOPs:

figure 7: Object oriented programming(OOP)

10
Object-Oriented Programming (OOP) is a programming paradigm in computer
science that relies on the concept of classes and objects. It is used to structure a
software program into simple, reusable pieces of code blueprints (usually called
classes), which are used to create individual instances of objects. There are
many object-oriented programming languages, including JavaScript, C++, Java,
and Python.

The characteristics of OOPs:

figure 8: Characteristic of OOP

In OOP, There are six characteristics popular in all the language of computer (Tran, 2021):

 Class: Classes are the blueprints or templates that define the attributes and
methods of objects. Classes can be used to create instances of objects that
share the same properties and behavior. For example, a class named Car
can define the attributes such as color, brand, and model, and the methods
such as start, stop, and accelerate. A class can also have constructors,
which are special methods that are used to initialize the objects when they
are created.

11
figure 9: class

 Objects: Objects are the basic units of software that represent real-world entities.
Objects have an identity, state, and behavior. Each object contains data and code
to manipulate the data. Objects can interact with each other by sending messages
or calling methods.

figure 10: Objects

 Data abstraction: Simplifying complex objects by defining classes with


abstract data types, hiding the implementation details and exposing
only relevant features to the outside world.

12
figure 11: Data abtraction

 Data Encapsulation:

The bundling data (attributes) and methods that operate on the data
within a single unit (class). It helps control access to the data and ensures
data security.

figure 12: Data encapsulation

 Polymorphism: Polymorphism is the ability of objects to behave differently


depending on their type or context. Polymorphism can be achieved by
using method overriding or method overloading. Method overriding is
when a subclass defines a method with the same name and parameters as
the superclass, but with a different implementation. This allows the

13
subclass to modify or extend the behavior of the superclass. Method
overloading is when a class defines multiple methods with the same name
but different parameters. This allows the class to provide different ways of
performing the same task. For example, a class named Calculator can have
multiple methods named add that can take different types or numbers of
arguments.

figure 13: Polymorphism in OOP

 Inheritance: Inheritance is the mechanism that allows classes to inherit


attributes and methods from other classes. This creates a hierarchy of
classes that are related to each other by a parent-child relationship. The
subclass can inherit all the attributes and methods from the superclass, and
also add its own or override the inherited ones. For example, a subclass
named Truck can inherit from the superclass Car, and also add an attribute
named cargo and a method named load.

14
figure 14: Inheritance

Advantages of OOPs:

The programming guide object is a method implementation that uses objects as


the unit basis of the software. Objects have specifically defined data (properties)
and behavior (methods) and their functions. Objects can interact with each other
by sending messages or calling methods. Objective programming guides making
source code modular, using regeneration and adaptation using concepts such as
classes, inheritance, polymorphism, and encapsulation.

- Below are some advantages of object-oriented programming:


 Object-oriented programming makes coding modular, easy to
understand, maintainable, and extensible.
 Object programming guides the creation of software libraries that can
be used and integrated over time.
 Programming describes the help of the command object implemented in
the problem honestly and completely.
 Create tutorials to help develop software faster, save costs and improve
quality.

Disadvantages of OOPs:

15
The programming guide object is a method implementation that uses objects as
the unit basis of the software. Objects have specifically defined data (properties)
and behavior (methods) and their functions. Objects can interact with each other
by sending messages or calling methods. Objective programming guides making
source code modular, using regeneration and adaptation using concepts such as
classes, inheritance, polymorphism, and encapsulation.

- Below are some weaknesses of the programming instruction object:


 Programming teaching objects with deep learning curves requires a lot
of knowledge and skills.
 Object programming commands can produce slower and larger
programs due to the use of many objects and methods.
 Teaching object programming is not suitable for all types of
problems, especially problems that require fast and efficient
calculations.

Application of OOPs:

- Real Time Systems

- Client Server System

- Hypertext and Hypermedia

- Object Oriented Database

- Neural Networks and Parallel Programming

- AI Expert Systems

- Simulation and Modeling System

- CIM/CAD/CAM Systems

- Computer Aided Designs

An example of OOPs:

16
- This example will simulate a simple object class "Person" with properties such as
name, age, and method to display the person's information:
Source code:

figure 15: OOP example code

Code Run:

17
figure 16: Code run

c. Event driven programming (EDP).

figure 17: Event-driven programming

Definition EDP:

Event-driven programming or event-driven programming is a school of programming


where entities communicate indirectly with each other by sending messages to each
other through a middleware. Messages are stored in a queue before being processed by
consumers.

Unlike using direct method calls, event-driven programming completely separates


producers and consumers, which gives us some distinct benefits. As can be seen, multiple
producers as well as multiple consumers can cooperate to handle incoming requests.

18
Event-driven programming also allows us to scale large systems easily by increasing the
number of consumers.

The characteristics of EDP:

- Asynchronous Execution: The program operates non-linearly, responding to events as


they happen, allowing multiple tasks to be performed simultaneously.

- Event-Listener Model: Components or objects register as event listeners to


particular events. When an event occurs, registered listeners are notified and
perform appropriate actions.

- Event Loops: Fundamental part that continuously monitors and dispatches events to
event handlers.

- User-Driven Interaction: User interactions drive program execution, waiting for user
actions before proceeding.

- Flexibility and Modularity: Promotes easy addition, removal, or modification of


components without affecting the entire program's structure.

- GUI Development: Extensively used in graphical user interface development to trigger


responses to graphical elements.

- Non-Blocking Operations: Encourages responsiveness during long-running tasks or


I/O operations.

- Event Propagation: Some systems allow events to propagate through a hierarchy of


objects, providing a flexible control flow.

Advantages of EDP:

- Simplicity: When compared to other types of programming languages, event driven


programming is more easier to use. Once there is a business requirement, the
development of the program is hassle free.

19
- Convenience: Predictive coding is another feature of event driven programming.
With the help of languages like visual basic, predictive coding is made possible. When
the developer is typing the code, the relevant suggestions are given.

- Flexibility: In event driven programming, there is no specific order from start to finish.
This order can make it easy to carry out the code. In addition to that, this is a type of code
that can be altered when necessary. If there is a requirement or errors in coding, the
code is flexible to be changed.

- GUI Support: A pre-programmed toolbar in the form of Graphical User Interface


(GUI) is available in event driven programming. From this toolbar it is able to create
more interactive programs. For an example, tools such as radio buttons are already
included. - Power Consumption: Implementation of event driven programming is from
hardware interrupts. As a result, there is considerably less power consumption.

Disadvantages of EDP:

- Speed: As event driven programming is based on GUIs. the programs overall


execute reduced performance. Especially, if the installed memory is insufficient. -
Complexity: Event driven programming is too complex for simple programs. The flow of
the program and stack management is all what makes EDP more complex. If it is a
small program, it is worth considering other options like batch programming.

- Resource Utilization: Event driven programming uses main loop which is well known to
drain system resources. Because, the main loop is constantly functioning in the
background. Moreover, due to the usage of GUI, EDP cannot provide an interface unless
the required specifications are met.

- Language Translation: Once a program is written using the EDP language, you
cannot translate it to a different language. Because some functionalities like button are
programmed to work only with event driven programming.

- Platform Support: Generally, event driven programming is platform dependent.


When a particular program uses EDP, it cannot function on other platforms. For an

20
example, the program visual basic works using windows library files. If the program is
moved to a different OS, these files cannot be found

An example of OOPs:

- Code the login interface and create an account:


Souce code:

21
figure 18: Source code of login interface and creat an accout

d. Relationship between Procedural, Object-oriented, Event-driven.

Figure 19: relationship between OOP and POP

22
POP (Procedural Oriented Programming), OOP (Object-Oriented Programming), and
EDP (Event-Driven Programming) are three different programming paradigms, and they
have the following relationships and differences:

POP (Procedural Oriented Programming):

Figure 20: POP

Description: A programming model that focuses on the process (or order of steps) and
functions or methods.

Characteristic:

o The division of a program into functions or procedures to perform specific work.


o Data and source code are not organized into objects.
o Usually use global variables and local variables.
o There is a tendency to rely on breaking down problems into steps and
performing them sequentially.

OOP (Object-Oriented Programming):

23
Figure 21: OOP

Description: A programming model that focuses on objects, each object has state (data) and behavior
(methods).

Characteristic:

o Data and behavior are organized into objects.


o Use concepts like inheritance, polymorphism, and encapsulation to create reusable
and maintainable objects.
o Objects interact with each other through predefined interfaces (APIs).

EDP (Event-Driven Programming):

Description: A programming model that focuses on event handling and reactions when
events occur.

Characteristic:

Programs are designed to respond to events such as mouse clicks, key presses, or system events.

Commonly used in applications with a user interface, where user interactions generate events.

Use an event loop to monitor and handle events.

The relationship between them:

24
Although it is possible to use both POP and OOP in a project, they often reflect different
implementations and design decisions.

EDP is often integrated with both POP and OOP. In an OOP environment, objects can react on
events, while POPs can be used to handle specific events.

An application can use both POP and OOP for the logic model, while using EDP for user event
handling.

In summary, POP, OOP, and EDP are not necessarily mutually exclusive and are often combined
to create powerful and efficient applications. The choice between them depends on the specific
requirements of the project and the satisfaction of the development team.

1.2. Compare the procedural, object-orientated and event-driven


paradigms used in given source code of an application. (M2)

Procedural:

o Look for functions or procedures that carry out specific tasks in a step-by-step
manner.
o Check if the code follows a sequential flow.

Object-Oriented:

o Identify classes and objects in the code.


o Check for the use of inheritance, encapsulation, and polymorphism.
o Look for instances where data and behavior are bundled together in objects.

Event-Driven:

o Identify events and event handlers in the code.


o Check if there are callbacks or functions associated with specific events.

25
1.3. Critically evaluate the source code of an application that implements
the procedural, object-orientated and event-driven paradigms, in terms
of the code structure and characteristics. (D2)
2. Implement basic algorithms in code using an IDE. (LO3)
Introduction about IDE:
- IDE definition: IDE is the Integrated Development Environment that provides the
user interface for code development, testing, and debugging features. It helps to
organize the project artifacts relevant to the software application’s source code. It
provides several tools and features to make development easy and standardized
based on the programming language the developer writes the code. The IDEs also
have the functionalities to compile and interpret the program. Some widely used IDs
are Eclipse for Java programming development, Microsoft Visual Studio, Android
Studio for Mobile Apps Development, RStudio for R programs, and PyCharm for
Python programming.

Figure 22: IDE

26
- Visual Studio is a well-known and widely used integrated development
environment (IDE) among professional programmers, particularly those working
with languages like VB+ and C#. It has a rich history of development and continuous
improvement over the years.

Figure 23: Visual studio

- History of Visual Studio: Visual Studio was first released in 1997. The first version of
Visual Studio was numbered "Visual Studio 97" and was released in February
1997. Before that, Microsoft had separate development tools. for each language
such as Visual Basic, Visual C++ and Visual FoxPro.

Figure 24: Visual studio 97

2.1. Write a program that implements an algorithm using an IDE. (P4)

27
- In this part, I will write an event-driven program that creates a Windows form to caculate
a water bill. First, I will talk about the properties and functions of the components that I
will use to write the program:

+ I will write a program Winforms that uses the IDE that is Visual Studio to create a user
interface with common main functions such as login / account creation and user interface,
these functions including:

Login

Figure 25: login form

To enhance security for the purpose of authenticating users before allowing


administrators To access important functions or data of the application, we need a
login interface. When the user opens app, they will be asked to provide credentials
such as username and password to open it. management interface

Main:

28
Figure 26: main form

Next, create a class customet:

Figure 27: customer class

29
Design the customer management form interface as follows:

Figure 28: invoice management form

Build functions and catch events for the program:

30
Figure 29: login button

31
Figure 30: add button

32
Figure 31: update button

33
Figure 32: search button

34
Figure 33: calculate-function

35
Figure 34: delete function

To expand the program, we build a login form so users can log in before entering the

page form of management.

The steps are as follows:

- Design the login form interface as shown below:

36
Figure 35: login form

Program result

- When running the program, a login form will be displayed

If the user enters the wrong username or password, the program will display the message ; User
or the password is incorrect! .

In case the user enters the correct username and password, button. And then the invoice
management interface will appear:

37
Figure 36: display screen

In case the user enters the correct username and password, button. And then the invoice
management interface will appear:

38
Figure 37: form login correct

Figure 38: main form appear

39
If you press the 'back' button, you will return to the invoice page

Figure 39: display screen

When you successfully enter admin, it will display on this page

40
Figure 40: edit successful

41
And here is the bill to calculate the money bill:

Figure 41: bill

42
2.2. Enhance the algorithm written, using the features of the IDE
to manage the development process. (M3)
3. Determine the debugging process and explain the importance of a

coding standard. (LO4)


3.1. Explain the debugging process and explain the debugging
facilities available in the IDE. (P5)

43
• Debug process: The debugging process is a crucial part of software
development that involves identifying and fixing errors, defects, or
unexpected behaviors in a program.
• What is debuging:
o Debugging is the process of identifying and fixing errors, defects, or
unexpected behaviors in a software program. The term "bug" was famously
coined by Grace Hopper when an actual moth caused a malfunction in the
Mark II computer in 1947. Debugging is an essential part of the software
development lifecycle and is performed to ensure that a program behaves as
intended and produces the correct results.
o The primary goals of debugging are:
o
o Identifying Issues:
o
o Understanding and recognizing that there is a problem in the code. This
could be due to logical errors, syntax mistakes, or unexpected behaviors.
o Isolating the Problem:
o Narrowing down the scope of the issue to specific sections of code or
modules. This helps in focusing efforts on the part of the code where the
problem is located.
o Analyzing the Cause:
o Investigating the root cause of the problem. This involves examining the
code, variables, and program flow to understand why the software is not
behaving as expected.
o Fixing the Bug:
o Implementing corrections or modifications to the code to eliminate the
identified issue. This could involve changing the logic, fixing syntax errors,
or adjusting the program's configuration.
o Verifying the Fix:

44
o Testing the modified code to ensure that the issue has been resolved and
that the program now functions correctly. This often involves running various
test cases to validate the software's behavior.
o Debugging techniques can vary and may include:
o Print Statements: Inserting statements in the code to print out variable
values or status messages at different points in the program's execution.
o Logging: Using logging frameworks to capture information about
the program's behavior during runtime.
o Debugging Tools: Leveraging integrated development environments (IDEs)
and specific debugging tools to set breakpoints, step through code, and
inspect variables.
o Code Reviews: Collaborating with team members to review the code
and identify potential issues.
o Unit Testing: Writing and running automated tests to verify the correctness
of individual units or components of the code.
o Profiling: Analyzing the program's performance and resource usage to
identify bottlenecks or inefficiencies.
 Why it is important?

Debugging is crucial for several reasons in the software development process:

o Identifying and Fixing Errors: Debugging is the process through which programmers
identify and correct errors, bugs, or unexpected behaviors in their code. This is
essential for ensuring that a software program works as intended and produces
the correct results.
o Ensuring Software Reliability: Debugging contributes to the overall reliability and
stability of software. By identifying and fixing issues, developers can prevent software
from crashing, hanging, or producing incorrect outputs, which improves the user
experience.
o Maintaining Code Quality: Debugging is a fundamental aspect of maintaining
code quality.
o Identifying and resolving issues leads to cleaner, more readable, and more
maintainable code.

45
o This is crucial for the long-term sustainability of a software project.
o Meeting User Expectations: Debugging helps ensure that the software meets user
expectations and requirements. Users expect software to behave as specified, and
debugging is the process that bridges the gap between the intended functionality
and the actual behavior.
o Saving Time and Resources: Early and effective debugging can save significant time
and resources in the software development lifecycle. Identifying and fixing issues
during development or testing phases is generally more efficient than dealing with
problems after the software has been deployed.
o Enhancing Developer Productivity: Debugging tools and techniques, such as
integrated development environments (IDEs) and version control systems, contribute
to developer productivity. These tools streamline the process of locating and fixing
bugs, allowing developers to work more efficiently.
o Improving Software Security: Bugs or vulnerabilities in software can be exploited by
malicious actors. Debugging is an essential step in identifying and fixing security-
related issues, thus improving the overall security posture of the software.
o Facilitating Collaboration: In a collaborative development environment, debugging
helps team members understand and troubleshoot each other's code. Code reviews
and collaborative debugging sessions contribute to knowledge sharing and the
overall success of the team.
o Supporting Continuous Integration and Deployment: Debugging is crucial in
continuous integration and deployment workflows. It ensures that code changes are
thoroughly tested, and any issues are addressed before new versions of the software
are deployed. Enhancing the Development Process: The insights gained during the
debugging process contribute to a developer's understanding of the software. This
knowledge can be applied to improve future coding practices and avoid similar
issues in subsequent projects
 The Debugger
A debugger is a software tool that helps programmers identify and fix errors, bugs, and
unexpected behaviors in their code. Debuggers provide a set of features and
capabilities that assist developers in analyzing the execution of a program, inspecting
variables, setting breakpoints, and controlling the flow of code during runtime. The
primary goal of a debugger is to make the debugging process more efficient and
effective.
 Describe the debugging process:

46
 Coding standards:
o Coding standards are a set of guidelines and rules that developers follow when
writing code. These standards are designed to ensure consistency, readability, and
maintainability of code across a software project or development team. Adopting
coding standards has several benefits, including improved collaboration, easier
debugging, and enhanced overall code quality. While specific coding standards
may vary based on the programming language and the preferences of a
development team or organization, some common elements include:
o Indentation and Formatting:
o Consistent indentation helps improve code readability. Standards often specify the
number of spaces or tabs for each level of indentation. Additionally, guidelines for
code formatting, such as line length limits and placement of braces, contribute to
a consistent code style.
o Naming Conventions:
o Guidelines for naming variables, functions, classes, and other code elements help
maintain clarity and consistency. Common conventions include using camelCase or
snake_case for variable names and following specific patterns for class names.
o Comments and Documentation:
o Standards often define how and when to use comments in the code. This includes
providing explanations for complex sections, commenting on the purpose of
functions or methods, and documenting code interfaces. Consistent documentation
improves code understanding for both current and future developers.
o Code Structure:
o Standards may provide guidance on how to structure code files, organize imports,
and arrange functions or methods within a file or class. A consistent structure
makes it easier for developers to navigate and understand the codebase.
o Error Handling:
o Guidelines for error handling and exception usage help ensure that code
responds appropriately to unexpected situations. Consistent error-handling
practices contribute to robust and reliable software.
o Variable Declarations:
o Standards often specify how to declare variables, including rules for variable
initialization, constant naming conventions, and the use of global or local variables.

 Naming Conventions:

47
3.2. Explain the coding standard you have used in your code. (P6)
Analyze the common features of an IDE:

An IDE, or Integrated Development Environment, is a software application that provides a


comprehensive set of tools for software development. It combines the functionality of
several programs, such as a code editor, a compiler, a debugger, and a terminal, into a
single graphical user interface. An IDE can help developers to write, manage, and execute
code more efficiently and effectively.

Some of the common features of an IDE are:

Code editor: A code editor is a text editor that allows developers to write and edit source
code. It usually supports syntax highlighting, code completion, code folding, and error
checking. It may also offer features such as code snippets, refactoring tools, and code
navigation.

Compiler: A compiler is a program that translates human-readable source code into


machinereadable instructions that can be executed by a computer. A compiler usually
performs tasks such as lexical analysis, syntax analysis, semantic analysis, code
optimization, and code generation. Some IDEs have built-in compilers for the languages
they support, while others require external compilers to be configured.

Debugger: A debugger is a tool that helps developers to test and debug their code. It
allows developers to run their code step by step, inspect the values of variables, set
breakpoints, and watch expressions. It also shows the locations of errors and exceptions
in the code and provides information about the program state and stack trace.

Terminal: A terminal is a text-based interface that allows developers to interact with the
operating system and execute commands. It can be used to run scripts, compile code,
launch applications, and perform other tasks. Some IDEs have a built-in terminal that can
be accessed from within the IDE, while others require external terminals to be opened
separately.

Version control: Version control is a system that helps developers to track and manage
the changes to their code. It allows developers to create, merge, and switch between

48
different versions of their code, as well as collaborate with other developers. Some IDEs
support version control tools such as Git, SVN, or Mercurial, and provide graphical
interfaces for performing common operations such as committing, pushing, pulling, and
branching.

Extensions and plugins: Extensions and plugins are additional components that can be
installed to extend the functionality of the IDE. They can provide support for specific
languages, frameworks, libraries, or features that are not included in the core IDE. For
example, some extensions and plugins can enable code formatting, linting, testing,
debugging, or documentation generation.

Writing Source Code:


Developers write source code using a programming language like Python, Java, C++, or
others. This code represents the instructions and logic that the computer needs to
perform a specific task.

Compilation or Interpretation:

Depending on the programming language, the source code is either compiled or


interpreted. Compilation involves translating the entire source code into machine code or
an intermediate code, creating an executable file. Interpretation involves translating the
code line by line during runtime.

Compiler:

In languages like C or C++, a compiler is used to generate machine code from the source
code. The compiler checks for syntax errors, optimizes the code, and produces an
executable file. The resulting file can be run directly by the operating system.

Interpreter:

In languages like Python or JavaScript, an interpreter is used to execute the code. The
interpreter reads the source code line by line and performs the actions specified in the
code. Some interpreted languages may also use a Just-In-Time (JIT) compiler to optimize
performance.

49
Linking (for Compiled Languages):
In compiled languages, especially those with multiple source files, a linking step may be
necessary. Linking combines the machine code generated from different source files and
resolves references between them. This results in a single executable file.

Bytecode (for Some Languages):


Some languages, like Java, use an intermediate representation called bytecode. The
Java compiler translates source code into bytecode, which is then interpreted or
compiled at runtime by the Java Virtual Machine (JVM).

Packaging and Distribution:


Once the executable code is generated, it may need to be packaged along with any
necessary libraries or resources. The packaged application can then be distributed to
users or deployed to servers.

Execution:

Users or systems execute the generated executable code. For compiled languages, this
typically involves running the executable file directly. For interpreted languages, the
interpreter or runtime environment executes the code.

Optimizations (Optional):

In some cases, additional optimizations may be applied to the generated code to


improve performance. This can include compiler optimizations, such as inlining or
loop unrolling, or runtime optimizations for interpreted languages
3.2.1. Testing
Types of Testing:

Unit Testing: Testing individual units or components of the software in isolation.

o Integration Testing: Testing the interaction between different components or systems.


o System Testing: Testing the entire system to ensure that it meets the specified requirements.

50
o Acceptance Testing: Verifying that the system satisfies the acceptance criteria and is
ready for deployment.
o Techniques:
o Manual Testing: Testers manually execute test cases without using any automation tools.
o Automated Testing: Using tools and scripts to automate the execution of test cases.
o Regression Testing: Testing the software after changes to ensure that existing functionalities
still work.
o Performance Testing: Evaluating the system's performance under different conditions.
o Best Practices:
o Early Testing: Start testing as early as possible in the development lifecycle.
o Test in Isolation: Ensure that tests are independent and can be run in isolation.
o Continuous Integration: Integrate testing into the development process using
continuous integration tools.
o Boundary Testing: Test the software at the boundaries of its input space to uncover
potential issues.
o Tools:
o Unit Testing Frameworks: Examples include JUnit (Java), NUnit (C#), and pytest (Python).
o Automation Tools: Selenium for web applications, JIRA for test management, etc.
o Performance Testing Tools: JMeter, Gatling, etc.
o Static Analysis Tools: SonarQube, ESLint, etc.

3.2.2. Languages that are supported by IDE.

Integrated Development Environments (IDEs) support a wide range of programming


languages, and the level of support can vary based on the IDE itself. Some IDEs are
designed to be language-specific, while others are more versatile and support multiple

51
languages. Here are some popular programming languages and examples of IDEs that
support them:

• Java:
Eclipse

IntelliJ IDEA

NetBeans

• C/C++:
Visual Studio (Microsoft)

• Python:
PyCharm (by
JetBrains)

Visual Studio Code

IDLE (Python's default IDE)

Spyder

• JavaScript:
Visual Studio
Code

WebStorm (by JetBrains)

Atom

• C#:
Visual Studio (Microsoft)

Rider (by JetBrains)

• PHP:

52
PhpStorm (by JetBrains)

Visual Studio Code

53
Eclipse PDT

• Ruby:
RubyMine (by JetBrains)

Visual Studio Code

• Swift: Xcode (Apple) • Kotlin:

IntelliJ IDEA

Android Studio (for Android development)

HTML, CSS, and Web Development:

Visual Studio

Code Sublime

Text Atom

5.7 Different type of IDE

ntegrated Development Environments (IDEs) come in various types, each tailored to


specific programming languages, development purposes, or workflows. Here are some
common types of IDEs:

Language-Specific IDEs:

• These IDEs are designed to support a specific programming language. Examples


include:
• Eclipse for Java development
• Xcode for Swift and Objective-C development
• PyCharm for Python development
Cross-Platform IDEs:

• These IDEs support multiple programming languages and are designed to


work across different operating systems.

54
• Visual Studio Code: A lightweight, cross-platform IDE supporting various
languages.
• IntelliJ IDEA: Supports Java, Kotlin, Scala, and other languages.

Web Development IDEs:

• IDEs specifically designed for web development, including support for HTML,
CSS, JavaScript, and server-side languages.
• Visual Studio Code
• Atom
• Sublime Text
Mobile Development IDEs:

• IDEs tailored for mobile app development, often supporting languages like Java,
Kotlin, Swift, or languages specific to mobile platforms.
• Android Studio: For Android app development (supports Java and Kotlin).
• Xcode: For iOS app development (supports Swift and Objective-C).

Data Science and Analytics IDEs:


• IDEs designed for data analysis, statistical modeling, and machine learning.
• Jupyter Notebooks
• RStudio: For R programming
• Spyder: For Python scientific computing
Game Development IDEs:

• IDEs specialized for game development with tools and features specific to creating
games.
• Unity: For developing 2D and 3D games.
• Unreal Engine: For high-end game development.
5.8 Multi-language IDE

Multi-language IDEs (Integrated Development Environments) are tools that support and
provide features for multiple programming languages. These IDEs are versatile and
enable developers to work on projects involving different languages without having to
switch between different development environments.

55
Here are some popular multi-language IDEs:

Visual Studio Code (VS Code):

• Languages Supported: JavaScript, TypeScript, HTML, CSS, Python, Java, C++,


C#, Go, Ruby, and many more.
• Features: Lightweight and extensible, with a rich ecosystem of extensions
for various languages.
IntelliJ IDEA:

• Languages Supported: Java, Kotlin, Groovy, Scala, JavaScript, TypeScript,


HTML, CSS, and more.
• Features: Robust support for Java development and excellent support for
various languages through plugins.

Eclipse:

• Languages Supported: Java, C/C++, PHP, Python, Ruby, JavaScript, and more.
• Features: Highly extensible, supports a wide range of plugins for different
languages and frameworks.

NetBeans:

• Languages Supported: Java, HTML, JavaScript, PHP, C/C++, and more.


• Features: Built-in support for multiple languages, especially strong for Java
development.
Atom:

• Languages Supported: JavaScript, TypeScript, HTML, CSS, Python, Ruby, PHP,


Go, and more.
• Features: Highly customizable and extensible, supports a wide range of languages
through packages.

Sublime Text:

• Languages Supported: Python, JavaScript, HTML, CSS, Java, C++, and more.

56
• Features: Lightweight, fast, and supports many languages with a wide range
of plugins.
Code::Blocks:

• Languages Supported: C, C++, Fortran.


• Features: Cross-platform, simple and easy to use, primarily focused on C and C++
development.
CLion:

• Languages Supported: C, C++, and others.


• Features: Specifically designed for C and C++ development with smart
code completion and analysis.

Xcode:

• Languages Supported: Swift, Objective-C, C, C++, and more.


• Features: Developed by Apple for macOS and iOS development, supports multiple
languages.
Android Studio:

• Languages Supported: Java, Kotlin.


• Features: Specifically designed for Android development, supports Java
and Kotlin.
Komodo IDE:

• Languages Supported: Python, PHP, Ruby, JavaScript, HTML, CSS, and more.
• Features: Multi-language support, including strong capabilities for
web development..
4. CONCLUSION.
In tackling the formidable challenge of crafting a robust customer invoice management
application, I seamlessly employed a myriad of programming paradigms within the confines
of a sophisticated Integrated Development Environment (IDE). By embracing the tenets of

57
Object-Oriented Programming (OOP), I sculpted a codebase adorned with classes and
objects, thereby fostering an architecture that not only encapsulates functionality
but elevates reusability and maintainability to paramount heights.

The symphony of Event-Driven Programming echoed through my application, harmonizing


with user actions and choreographing interactions that seamlessly intertwined with the
fabric of security implementations. This not only fortified the application against potential
vulnerabilities but also bestowed upon it the responsiveness required for a dynamic user
experience.

Central to this triumph was the instrumental role played by a powerful IDE, an indispensable
companion in my development journey. The code editor, akin to a virtuoso conductor,
orchestrated lines of code with finesse; debugging tools acted as vigilant sentinels, guarding
against the incursion of bugs; version control integration facilitated a collaborative dance
with team members, ensuring a harmonious synchronization of efforts; and deployment
management unfurled a red carpet, easing the transition from the crucible of development
to the grand stage of production.

In the crucible of this interview task, I not only showcased my proficiency in programming
but also demonstrated a penchant for strategic thinking and problem-solving. The end
result is an impervious bastion of a customer invoice application, where OOP and event-
driven paradigms converge, and secure coding stands as a sentinel against the ever-looming
specter of data breaches. This experience has not only been a testament to my technical
prowess but also an ode to the collaborative symphony orchestrated by a potent IDE.

5. CRITICAL EVALUATE.

In undertaking the formidable task of creating a secure and fully functional customer invoice
management application, I harnessed various programming models within the realm of a
sophisticated Integrated Development Environment (IDE). The utilization of Object-Oriented
Programming (OOP) principles proved to be a cornerstone in structuring the codebase,
creating an architecture adorned with classes and objects. This approach not only enhanced

58
the organization of functionality but also fostered reusability and maintainability,
contributing to a robust foundation for the application.

The incorporation of Event-Driven Programming added another layer of complexity,


responding dynamically to user actions and fortifying the application's interactivity. This
paradigm not only ensured responsiveness but also played a pivotal role in implementing
crucial security measures, safeguarding sensitive data from potential threats.

The choice of a powerful IDE emerged as a strategic ally throughout the development
process. The code editor functioned as a precision instrument, facilitating the creation and
modification of code with efficiency. Debugging tools served as vigilant guardians,
identifying and rectifying potential issues, while version control integration and deployment
management streamlined collaboration and transition to the production environment.

However, as with any endeavor, critical evaluation unveils areas for potential improvement.
While OOP and Event-Driven Programming were implemented effectively, a deeper analysis
could reveal opportunities for optimization or alternative approaches. Additionally,
documentation and comments within the code could be scrutinized for clarity and
completeness, ensuring that future developers can navigate and comprehend the intricacies
of the application seamlessly.

In conclusion, this interview task not only demonstrated technical proficiency but also
underscored the importance of strategic thinking and problem-solving. The resulting
customer invoice application stands as a testament to the fusion of OOP and event-driven
paradigms, yet the critical eye remains vigilant for areas of refinement. The symbiotic
relationship with a robust IDE, while instrumental, prompts a continuous quest for
excellence and efficiency in the ever-evolving landscape of software development.

6. REFERENTCE.

Programming paradigm (2023) Wikipedia. Available at:


https://en.wikipedia.org/wiki/Programming_paradigm

59
Ooad - Object Oriented Paradigm (no date) Online Tutorials, Courses, and eBooks Library. Available
at:
https://www.tutorialspoint.com/object_oriented_analysis_design/ooad_object_oriented_paradig
m. htm

Event-driven programming (2023) Wikipedia. Available at:


https://en.wikipedia.org/wiki/Eventdriven_programming
Object-oriented, event-driven and procedural programming - 1263 words: Report example (no
date) IvyPanda. Available at: https://ivypanda.com/essays/object-oriented-event-driven-
andprocedural-programming/
Heusser, Matt. “What Is Debugging?” Software Quality, TechTarget, 28 Nov. 2022,
www.techtarget.com/searchsoftwarequality/definition/debugging.
“Coding Standards and Guidelines.” GeeksforGeeks, GeeksforGeeks, 28 June
2022, www.geeksforgeeks.org/coding-standards-and-guidelines/.

File code: https://drive.google.com/file/d/1JuudVNREoIxv26_XpptHIRMgHO7uDfrb/view?usp=sharing

60

You might also like