0% found this document useful (0 votes)
102 views

Programing Assignment Brief

This document outlines the process for internal verification of assessment decisions for a Higher National Diploma in Computing program. It provides a checklist for an internal verifier to ensure assessment criteria were applied accurately by the assessor for an assignment submitted by student B.K. Ranuka Shavinda Rodrigo. The internal verifier must confirm that the assessor's grading matches the assignment brief, is justified by comments on the student's work, and that feedback to the student is constructive and identifies opportunities for improvement. Signatures are required from the assessor, internal verifier, and program leader if necessary.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Programing Assignment Brief

This document outlines the process for internal verification of assessment decisions for a Higher National Diploma in Computing program. It provides a checklist for an internal verifier to ensure assessment criteria were applied accurately by the assessor for an assignment submitted by student B.K. Ranuka Shavinda Rodrigo. The internal verifier must confirm that the assessor's grading matches the assignment brief, is justified by comments on the student's work, and that feedback to the student is constructive and identifies opportunities for improvement. Signatures are required from the assessor, internal verifier, and program leader if necessary.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 133

lOMoARcPSD|14560171

Programing assignment brief

HND in Computing (ESOFT Metro Campus)

StuDocu is not sponsored or endorsed by any college or university


Downloaded by Samzul Mohamed ([email protected])
lOMoARcPSD|14560171

Higher Nationals
Internal verification of assessment decisions – BTEC (RQF)

INTERNAL VERIFICATION – ASSESSMENT DECISIONS

Programme title Higher National Diploma in Computing

Assessor Internal Verifier

Unit(s)

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Assignment title

B.K Ranuka Shavinda Rodrigo

Student’s name

List which assessment criteria Pass Merit Distinction


the Assessor has awarded.

INTERNAL VERIFIER CHECKLIST

Do the assessment criteria awarded match


those shown in the assignment brief?

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Y/N

Is the Pass/Merit/Distinction grade awarded


justified by the assessor’s comments on the Y/N
student work?

Has the work been assessed


accurately?

Y/N

Is the feedback to the student:


Give details:
• Constructive?

• Linked to relevant assessment criteria?


Y/N
Y/N
Y/N
Y/N

• Identifying opportunities for


improved performance?
• Agreeing actions?

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Does the assessment decision need


amending?

Y/N

Assessor signature Date

Internal Verifier signature Date

Programme Leader signature (if required)

Date

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Confirm action completed

Remedial action taken

Give details:

Assessor signature Date

Internal Verifier
signature

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Date

Programme Leader
signature (if required)

Date

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Higher Nationals - Summative Assignment Feedback Form

Student Name/ID B.K Ranuka Shavinda Rodrigo / 00070015

Unit Title

Assignment Number Assessor

Date Received 1st


submission

Submission Date

Date Received 2nd


submission

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Re-submission Date

Assessor Feedback:

LO1. Define basic algorithms to carry out an operation and outline the process of programming an application.

Pass, Merit & Distinction Descripts P1


M1
D1

LO2. Explain the characteristics of procedural, object-orientated and event-driven programming, conduct an analysis of a suita
Integrated Development Environment (IDE).

Pass, Merit & Distinction Descripts P2


M2
D2

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

LO3. Implement basic algorithms in code using an IDE.

Pass, Merit & Distinction Descripts P3


M3
D3

LO4. Determine the debugging process and explain the importance of a coding standard.

Pass, Merit & Distinction Descripts P4


P5
M4
D4

Grade: Assessor Signature: Date:

10

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Resubmission Feedback:

Grade: Assessor Signature: Date:

Internal Verifier’s Comments:

Signature & Date:

* Please note that grade decisions are provisional. They are only confirmed once internal and external moderation has taken place and
grades decisions have been agreed at the assessment board.

Assignment Feedback

Formative Feedback: Assessor to Student

11

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Action Plan

Summative feedback

12

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Feedback: Student to Assessor

Assessor Date
signature

Student Date
signature

13

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Pearson Higher Nationals in

Computing

Unit 01: Programming


Assignment 01

14

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

General Guidelines

1. A Cover page or title page – You should always attach a title page to your assignment. Use
previous page as your cover sheet and make sure all the details are accurately filled.
2. Attach this brief as the first section of your assignment.
3. All the assignments should be prepared using a word processing software.
4. All the assignments should be printed on A4 sized papers. Use single side printing.
5. Allow 1” for top, bottom , right margins and 1.25” for the left margin of each page.

15

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Word Processing Rules

1. The font size should be 12 point, and should be in the style of Time New Roman.
2. Use 1.5 line spacing. Left justify all paragraphs.
3. Ensure that all the headings are consistent in terms of the font size and font style.
4. Use footer function in the word processor to insert Your Name, Subject, Assignment No,
and Page Number on each page. This is useful if individual sheets become detached for any
reason.
5. Use word processing application spell check and grammar check function to help editing
your assignment.

Important Points:

1. It is strictly prohibited to use textboxes to add texts in the assignments, except for the
compulsory information. eg: Figures, tables of comparison etc. Adding text boxes in the body
except for the before mentioned compulsory information will result in rejection of your
work.
2. Carefully check the hand in date and the instructions given in the assignment. Late
submissions will not be accepted.
3. Ensure that you give yourself enough time to complete the assignment by the due date.
4. Excuses of any nature will not be accepted for failure to hand in the work on time.
5. You must take responsibility for managing your own time effectively.
6. If you are unable to hand in your assignment on time and have valid reasons such as illness,
you may apply (in writing) for an extension.
7. Failure to achieve at least PASS criteria will result in a REFERRAL grade .
8. Non-submission of work without valid reasons will lead to an automatic RE FERRAL. You will
then be asked to complete an alternative assignment.
9. If you use other people’s work or ideas in your assignment, reference them properly using
HARVARD referencing system to avoid plagiarism. You have to provide both in-text citation
and a reference list.
10. If you are proven to be guilty of plagiarism or any academic misconduct, your grade could be
reduced to A REFERRAL or at worst you could be expelled from the course.

16

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Student Declaration

I hereby, declare that I know what plagiarism entails, namely to use another’s work and to present
it as my own without attributing the sources in the correct way. I further understand what it means
to copy another’s work.

1. I know that plagiarism is a punishable offence because it constitutes theft.


2. I understand the plagiarism and copying policy of the Edexcel UK.
3. I know what the consequences will be if I plagiaries or copy another’s work in any of the
assignments for this program.
4. I declare therefore that all work presented by me for every aspects of my program, will be
my own, and where I have made use of another’s work, I will attribute the source in the
correct way.
5. I acknowledge that the attachment of this document signed or not, constitutes a binding
agreement between myself and Edexcel UK.
6. I understand that my assignment will not be considered as submitted if this document is not
attached to the attached.

Student’s Signature: Date:


(Provide E-mail ID) (Provide Submission Date)

17

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

18

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Higher National Diploma in Computing


Assignment Brief

Student Name /ID Number

Unit Number and Title Unit 01: Programming

Academic Year 2021/22

Unit Tutor

Assignment Title Design &Implement a GUI based system using a suitable


Integrated Development Environment

19

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Issue Date

Submission Date

IV Name & Date

Submission Format

This submission will have 3 components

1. Written Report

This 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. (The
recommended word count is 1,500–2,000 words for the report excluding annexures)

2. Implemented System (Software)


The student should submit a GUI based system developed using an IDE. The system should connect with a
backend database and should have at least 5 different forms and suitable functionality including insert, edit
and delete of main entities and transaction processing.

3. Presentation
With the submitted system student should do a presentation to demonstrate the system that was
developed. Time allocated is 10 to 15 min. Student may use 5 to 10 PowerPoint slides while doing the

20

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

presentation, but live demonstration of the system is required. Evaluator will also check the ability to
modify and debug the system using the IDE.

Unit Learning Outcomes:

LO1. Define basic algorithms to carry out an operation and outline the process of
programming an application.

LO2. Explain the characteristics of procedural, object-orientated and event-driven


programming, conduct an analysis of a suitable Integrated Development
Environment (IDE).

LO3. Implement basic algorithms in code using an IDE.

LO4. Determine the debugging process and explain the importance of a coding
standard

21

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Assignment Brief and Guidance:

Activity 1

A. The Fibonacci numbers are the numbers in the following integer sequence.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ……..
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence
relation.
F n = F n-1 + F n-2

B. Factorial of a non-negative integer, is multiplication of all integers smaller than or equal


to n. For example, factorial of 6 is 6*5*4*3*2*1 which is 720.
n! = n * (n - 1) * …….. 1

Define what an algorithm is and outline the characteristics of a good algorithm. Write the
algorithms to display the Fibonacci series and the factorial value for a given number using
Pseudo code. Determine the steps involved in the process of writing and executing a
program.
Take a sample number and dry run the above two algorithms. Show the outputs at the end
of each iteration and the final output. Examine what Big-O notation is and explain its role in

22

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

evaluating efficiencies of algorithms. Write the Python program code for the above two
algorithms and critically evaluate their efficiencies using Big-O notation.

Activity 2

2.1 Explain what is meant by a Programming Paradigm and the main characteristics
of Procedural, Object oriented and Event-driven paradigms and the relationships among
them. Write small snippets of code as example for the above three programming
paradigms using a suitable programming language(s). you also need to critically evaluate
the code samples that you have given above in relation to their structure and the unique
characteristics.

Activity 3 and Activity 4 are based on the following Scenario.

Ayubo Drive is the transport arm of Ayubo Leisure (Pvt) Ltd, an emerging travel & tour company
in Sri Lanka. It owns a fleet of vehicles ranging from cars, SUVs to vans.

The vehicles that it owns are hired or rented with or without a driver. The tariffs are based on
the vehicle type. Some of the vehicle types that it operates are, small car, sedan car, SVUs, Jeep

23

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

(WD), 7-seater van and Commuter van. New vehicle types are to be added in the future.

Vehicle rent and hire options are described below.

 Rent (With or without driver) – For each type of vehicle rates are given per day, per week
and per month. Rate for a driver also given per day. Depending on the rent period the total
rent amount needs to be calculated. For example: if a vehicle is rented for 10 days with a
driver, total amount to be calculated as follows:

Total rent = weeklyRent x 1 + dailyRent x 3 + dailyDriverCost x 10

 Hire (with driver only) – These are based on packages such as airport drop, airport pickup,
100km per day package, 200km per day package etc. Standard rates are defined for a
package type of a vehicle typeif that is applicable for that type of vehicle.For each package
maximum km limit and maximum number of hours arealso defined. Extra km rate is also
defined which is applicable if they run beyond the allocated km limit for the tour. For day
tours if they exceed max hour limit,a waiting charge is applicable for extra hours. Driver
overnight rate and vehicle night park rate also defined which is applicable for each night
when the vehicle is hired for 2 or more days.

24

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Activity 3

Function 1: Rent calculation.


Return the total rent_value when vehicle_no, rented_date, return_date, with_driver
parameters are sent in. with_driver parameter is set to true or false depending whether the
vehicle is rented with or without driver.

Function 2: Day tour - hire calculation.


Calculate total hire_value when vehicle_no, package_type, start_time, end_time,
start_km_reading, end_km_reading parameters are sent in. Should return base_hire_charge,
waiting_charge and extra_km_charge as output parameters.

Function 3: Long tour - hire calculation.


Calculate total hire_value when vehicle_no, package_type, start_date, end_date,
start_km_reading, end_km_reading parameters are sent in. Should return base_hire_charge,
overnight_stay_charge and extra_km_charge as output parameters.

Write suable algorithms for vehicle tariff calculation for rents and hires. Ideally 3
functions should be developed for this purpose as above. Use the visual studio IDE
(using C#.net) to Implement the above algorithms and design the suitable database
structure for keeping the tariffs for vehicle types and different packages which must be
used for implementing the above functions.
Analyze the features of an Integrated Development Environment (IDE) and explain how
those features help in application development. Evaluate the use of the Visual StudioIDE
for your application development contrasted with not using an IDE.

Activity 4

25

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

4.1 Design and build a small system to calculate vehicle hire amounts and record them in a
database for customer billing and management reporting forAyubo drive. This includes the
completing the database design started in 3.2 and implementing one or more GUIs for
vehicle, vehicle type, and package add/edit/delete functions. It essentially requires an
interface for hire calculation and recording function described above. Generating customer
reports and customer invoices are not required for this course work.

4.2 Explain debugging process and the features available in Visual studio IDE for debugging your
code more easily. Evaluate how you used the debugging process to develop more secure,
robust application with examples.

4.3 Outline the coding standards you have used in your application development. Critically
evaluate why a coding standard is necessary for the team as well as for the individual.

26

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

27

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

28

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Grading Rubric

Grading Criteria Achieved Feedback

LO1 Define basic algorithms to carry out an operation


and outline the process of programming an
application.

29

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

P1Provide a definition of what an algorithm is and outline


the process in building an application.

M1Determine the steps taken from writing code to


execution.

D1 Evaluate the implementation of an algorithm in a suitable


language. Evaluate the relationship between the written
algorithm and the code variant

LO2 Explain the characteristics of procedural,


objectorientated and event-driven programming,
conduct an analysis of a suitable Integrated

30

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Development Environment (IDE)

P2Give explanations of what procedural, objectorientated,


and eventdriven paradigms are; their characteristics and the
relationship between them.

M2 Compare and contrast the procedural, object


orientated and event driven paradigms used in given
source code of an application

D2Critically evaluate the source code of an application which


implements the programming paradigms, in terms of the
code structure and characteristics.

31

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

LO3Implement basic algorithms in code using an IDE.

P3Write a program that implements an algorithm using an


IDE.

M3Use the IDE to manage the development process of the


program.

32

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

D3Evaluate the use of an IDE for development of


applications contrasted with not using an IDE.

LO4 Determine the debugging process and explain


the importance of a coding standard

P4Explain the debugging process and explain the debugging


facilities available in the IDE.

P5Outline the coding standard you have used in your code.

33

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

M4Evaluate how the debugging process can be used to help


develop more secure, robust applications.

D4 Critically evaluate why a coding standard is necessary in


a team as well as for the individual.

34

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Acknowledgement

35

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Table of Contents

36

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

37

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

38

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

39

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

List of figures.

40

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Introduction.

Programing is term which usually refers to the conduct as well as the work of someone from
a specific profession. Professions are defined as occupations that need an extended period of
tutoring and training. They are usually supervised by professional bodies that may recognize
educational establishments and experienced professionals. Qualification may be
acknowledged by the title 'member of...', 'certified', 'fellow', and so on. These professional
bodies set standards of morals, performance, competency, insurance, training and so on that
must be met to endure within the profession. Classes and functions are used to control
commands in programming languages. Programming is crucial because it instructs a
computer to repeat these commands so that individuals do not have to perform the task
repeatedly. Instead, the software can accomplish it for you automatically and precisely.
Professional is common to any field of services such as engineering, medicine or information

41

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

technology. Understanding the programing and etc., is important to ensure her or his highest
satisfaction from his or her profession and the give the maximum service to the society.

Activity 1

42

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Define what an algorithm is and outline the characteristics of a good algorithm.


Write the algorithms to display the Fibonacci series and the factorial value for a
given number using Pseudo code. Determine the steps involved in the process of
writing and executing a program.

What is an Algorithm?

On around 825 A.D., a Persian author named Abu Jafar Mohammed ibn musa al
Khowarizmi wrote a mathematic treatise and coined the term "algorithm"
(Javatpoint,2020).
As an example,

An algorithm is a method for doing calculations or problem-solving tasks.

An algorithm is a set of rules or instructions that must be followed step by step in order to
get the desired outcome.

Algorithms are language agnostic; therefore, they can be utilized in any language.

The result will be the same. Algorithms can be utilized in multiple programming
languages.

A programming Algorithm will execute what to perform, and the computer will output the
results.

43

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Every single time. However, an algorithm is not a piece of computer code. Algorithms are
written in straightforward English. (Meinecke,2016; Prabhu,2020).

Example = Food recipes, in recipe there’s ingredients and set of steps to how to make
the expected meal. Algorithm are like that process (Meinecke,2016).

44

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Figure 1: An Algorithm (Source: Prabhu, 2020).

Figure 2: What is Algorithm (Source: Meinecke,2016).

The following figure 1 is sample of an Algorithm. Simply can get an idea of how algorithm
works.

45

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

In figure 2 Algorithm have Star, Middle and End as show in Above.

Algorithm can divide to 3 main Types of structures.

Sequence: The statement will be executing by line by line and process.


Selection: Depending on the condition true or false execution will be entire block or even
execute one block instead.
Repetition (Loop): The statement will be executing multiple times until a condition is met.

46

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

The algorithm represents such as Flowchart and Pseudocode. The difference of these 2 is
flowchart is a pictorial representation of algorithm while a flowchart is a high-level
description of algorithm (Lithmee,2019).

Figure 3:Different between pse and flow (Sourse:Lithmee,2019).

In figure 3 there’s difference between Pseudocode and Flowchart.

47

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Flowchart.

A diagram that shows step by step progressing thought a procedure or system especially
using connecting lines and a set of symbols (Lithmee,2019).
In programming flowcharts are mostly used.

48

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Figure 4:Sample flow chart(Source: Lithmee,2019).

49

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Below are Mostly used symbols in flowchart.

It represents the action or process.

It represents input output process.

It processes link to another page or flowchart.

Represents direction of a flowchart.

50

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Questions are written in diamond shapes.


Based on the question

Pseudocode.

Pseudocode is an informal high-level representation of the actual code that show how an
algorithm or a computer program work in plain simple English language. (Lithmee,2019).
Example:
sum of two numbers ()
Begin

51

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Set sum =0;


Read: number 1, number 2;
Set sum = number 1 + number 2;
Print sum;
End (Lithmee,2019).
Characteristics of good Algorithm.
Algorithm have certain characteristics to executing a program as mention below,
Unambiguous.
Input.
Output.
Finiteness.
Feasibility.
Independent.

Characteristics of a good algorithm,


Unambiguous.

The algorithm should be clear and unambiguous. Each steps and inputs and outputs should
be clear and need show a one meaning.

52

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Figure 5

Sample unambiguous (Source:Javapoint,2020).

Input.
The algorithm should have 0 or more defined inputs and should produce the anticipated
result.
Output.
To achieve the desired result, an algorithm must have at least one output.
Finiteness.
To solve a problem and produce a valid output, an algorithm should take a finite number of
steps.
Independent.
An algorithm should include step-by-step instructions. It should be language-independent.
Effectiveness.
An algorithm is also anticipated to be successful in most cases. This means that all of the
operations to be performed in the algorithm must be simple enough that they can be done
precisely and in a finite amount of time.
Generality.

53

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

the algorithm is applicable to a specific set of inputs.


Precision.
the steps are stated precisely. (tutorialspoint,2020).

Pseudocode to display Fibonacci series,


BEGIN
READ N
SET A=0,
B=1, SUM=0, COUNT=1
WHILE (COUNT<=N)
COUNT=COUNT+1
A=B
B=SUM

54

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

SUM= A+B
PRINT (SUM)
END WHILE
END

Pseudocode to display Factorial value,


START
READ N
SET F=1
WHILE N>=1
F=F*N
N=N-1
PRINT(F)
END WHILE
END

55

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Determine the steps involved in the process of writing and executing a program.

Defining the problem.


Planning the solution.
Coding the program.
Testing the program.
Documenting the program.

Defining the problem.


Assume you are called as a programmer because your services are required. You meet with
clients' users to examine the problem, or you meet with a systems analyst who defines the
project. Specifically, the task of describing the problem entails determining what you know
(input-given data) and what you want to get (output-the result). You eventually generate a
written agreement that outlines the type of input, processing, and output required, among
other things. This is not an easy process (Homepage.cs.uri.edu,2022).

Planning the solution.


Drawing a flowchart and writing pseudocode, or potentially both, are two typical methods
for preparing a problem's solution. A flowchart is essentially a visual depiction of a step-by-
step solution to a problem. It is made of arrows that show the program's direction and boxes
and other symbols that represent activities. It's a road plan for what your software will do
and how it will do it (Homepage.cs.uri.edu,2022).

Coding the program.

56

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

The next step for you as a programmer is to code the program—that is, to express your
answer in a programming language. You will convert the reasoning from a flowchart or
pseudocode—or other tool—to a programming language. As previously said, a
programming language is a collection of rules that instructs the computer on what actions to
conduct. Although programming languages are grammatically similar to English, they are
significantly more exact. To get your program to run, you must strictly adhere to the rules—
the syntax—of the language you are using. Of all, correctly using the language is no
guarantee that your software will work, any more than speaking grammatically correct
English implies that you know what you're talking about. The point is that proper language

usage is the necessary first step. The coded software must next be entered in, most likely
using a terminal or personal computer, in a format that the computer can understand.
Another thing to keep in mind is that programmers typically use a text editor, which is
similar to a word processing tool, to create a file that includes the program. However, as a
newbie, you should definitely start by writing your computer code on paper
(Homepage.cs.uri.edu,2022).

Testing the program.


Some experts believe that if a program is well-designed, it can be developed correctly the
first time around. In fact, they claim that there are mathematical methods for proving the
correctness of a program. However, because the world's defects are still with us, most
programmers come to terms with the fact that their newly built programs will almost
certainly contain a few flaws (Homepage.cs.uri.edu,2022).
Desk-checking. This process, like proofreading, is occasionally skipped by a programmer
searching for a shortcut and quick to execute the program on the computer after it is created.
However, thorough desk-checking may reveal several errors and potentially save you time
in the long run. Desk-checking entails just sitting down and mentally tracing, or verifying,
the logic of the program to ensure that it is error-free and workable. Many businesses take

57

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

this phase a step further with a walkthrough, which is a procedure in which a group of
programmers—your peers—review your software and make collegial comments.
Debugging. Debugging, a phrase commonly used in programming, refers to the process of
identifying, finding, and repairing defects (mistakes) by executing the program. These
defects are logic mistakes, such as instructing a computer to repeat an action but failing to
instruct it on how to cease doing it. During this stage, you execute the software using test
data that you create. To ensure that you test every aspect of the software, you must carefully
organize the test data (Homepage.cs.uri.edu,2022).

Documenting the program.


Although, like many programmers, you may be ready to pursue more interesting computer-
centered tasks, documentation is a continual, required effort. Documentation is a written
complete description of the programming cycle as well as individual program facts. The
genesis and nature of the issue, a brief narrative explanation of the program, logic tools like
as flowcharts and pseudocode, data-record descriptions, program listings, and testing results
are typical program documentation resources. Comments within the program are also

regarded to be an important aspect of documentation. Many programmers write


documentation as they code. Program documentation can, in a larger sense, be considered
part of the documentation for an entire system.
Throughout the design, development, and testing phases of the software, the intelligent
programmer continues to document it. Documentation is required to augment human
memory and to aid in the organization of program planning. Furthermore, documentation is
essential for communicating with others who are interested in the software, particularly
other programmers who may be part of a development team. And, because turnover in the
computer business is significant, written documentation is required so that people who
follow after you may make any necessary changes to the software or hunt down any faults
that you overlooked (Homepage.cs.uri.edu,2022).

58

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Take a sample number and dry run the above two algorithms. Show the outputs at
the end of each iteration and the final output. Examine what Big-O notation is and

59

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

explain its role in evaluating efficiencies of algorithms. Write the Python program
code for the above two algorithms and critically evaluate their efficiencies using Big-
O notation.
Dry run Fibonacci series,

60

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

61

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Examine what Big-O notation is and explain its role in evaluating efficiencies of
algorithms.

Big-O notation.
We utilize Big-O notation to express how long an algorithm takes to run (time complexity)
or how much memory it consumes (space complexity). The best, worst, and average-case
execution times of an algorithm can all be expressed using Big-O notation. We'll
concentrate on Big-O as it relates to time complexity for the sake of this discussion
(Linkedin,2020).

Constant Time.

Because regardless of the quantity of the input, running an algorithm requires a same
amount of time.

Bookmarks are an excellent example of how continuous time might manifest itself in the
"real world." Bookmarks allow a reader to quickly and efficiently find the last page that
they read. It makes no difference whether you're reading a book with 30 pages or a book
with 1000 pages. If you're using a bookmark, you'll be able to find the final page in a single
step.
Operations,

 math operations

62

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

 accessing an array via the index


 accessing a hash via the key
 pushing and popping on a stack
 insertion and removal from a queue
 returning a value from a function

When accessing the 0 index, passing small Collection or gigantic Collection results in the
same O (1) runtime. The return of first Index is a constant time operation as well. Both of
these actions will take the same amount of time regardless of the magnitude of time
(Linkedin,2020).

Figure 6: constant time (Source: Linkedin).

Linear time.
This indicates that the run time grows at the same rate as the input.
Reading a book is an illustration of how linear time might behave in the "real world."
Assume that reading a single page of a big print book takes me precisely one minute. Given

63

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

that, a 30-page book will take me 30 minutes to read. Similarly, a book with 1000 pages
equals 1000 minutes of reading time. Now, I don't push myself to complete bad novels, so
there's always the possibility that I won't get through that 1,000-page tome. However, before
I begin reading it, I know that my worst-case reading time for a 1000-page book is 1000
minutes.
The number of operations required to loop over n is proportional to the size of n. In general
(but not always), finding a loop is a good sign that the particular bit of code you're looking
at has a run time (Linkedin,2020).

Figure 7:Linear time(Source:Linkedin)

64

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Quadratic Time.

The calculation takes quadratic time, which is the square of the input data size.

Many of the most fundamental sorting algorithms in programming have a worst-case


execution time of O(n2).
Bubble Sort
Insertion Sort
Selection Sort
After each iteration, we have two nested loops that increase the operations variable. If n is
the size of our small Collection, we'll have a total of 16 operations. It's not that bad. But
what if n represents our massive collection? A quintillion (or 1,000,000,000,000,000,000) is
a billion times a billion. Oh, no. That's a significant number of operations. Even a small
array of 1,000 items would result in a million operations (Linkedin,2020).

65

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

66

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Figure 8: Quadratic (Source:Linkedin).

logarithmic Time.
So, the running time grows in proportion to the logarithm of the input size, implying that
while the input size grows exponentially, the run time minimally increases.
This process of searching through a physical dictionary is an example of a binary search
operation in programming, which is the most commonly used example when discussing
logarithmic run times (Linkedin,2020).

 Merge sort.

67

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

 Tim sort.
 Heap sort.

Big-O Cheat Sheet.

68

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Figure 9: Big - o complexity chart(source:Likedin).

Measure Algorithm efficiency.

 CPU speed.
 Operating system efficiency.
 Memory capacity.

69

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

 CPU and Memory load at the time of running.

Importance of Big- o notation.

The significance of big O notation is that it provides an approximate estimate of how the
program will behave when "scaled" to address larger (more complicated) issues.

A program that scales linearly — i.e. O(n) — slows down proportionally to the amount of
input it receives, similar to how a line does: two times the work, twice the time to complete it,
four times the work, four times the time to complete it—simple ratio. A program that scales
quadratically, i.e. O(n2), becomes substantially slower much faster than that, requiring two
times the work and four times the time to complete. And it took four times as much effort and
sixteen times as long to complete. When you double the task by 100, it takes 10,000 times as

70

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

long. As a result, when employed in production contexts with high demands, a program with
O(n2) becomes unworkable. It's not easy to add extra hardware to make it "quick enough."
Because the program is O(2n), even moderately small inputs rapidly become excessively
enormous; add one more item, and the time doubles; add two things, and the time doubles
again.

If the software is O (log n), on the other hand, you may double the amount of work it needs to
accomplish while just being a fraction slower. It doesn't matter how big the problem is; it
always takes the same amount of time to fix it. There are other others. O (n log n) is better
than quadratic but not nearly as good as linear. Cubic is more difficult to solve than quadratic,
but not as difficult as exponential. The list goes on (Quora).

Python code for Fibonacci series.

71

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Figure 10: Fibonacci series. (Author create).

Python code for Factorial.

72

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Figure 11:Factorial (Author create).

Activity 2

Explain what is meant by a Programming Paradigm and the main characteristics of


Procedural, Object oriented and Event-driven paradigms and the relationships among
them. Write small snippets of code as example for the above three programming
paradigms using a suitable programming language(s). you also need to critically
evaluate the code samples that you have given above in relation to their structure and
the unique characteristics.

What is programming paradigm,


A programming paradigm is a method, strategy, or style for writing programs in a particular
programming language to address a problem.

73

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

what style or approach we're referring to. It is a method of building objects and programs in
object-oriented programming, a method of solving issues using a sequence of functions in
functional programming, or a method of creating logic with a series of symbols in logic
programming.
If a programming language supports or comes under a certain paradigm, it indicates it has a
unique feature or takes a specific approach to solve a specific type of problem.
Example;

 By concealing critical data and identifying methods with the entities, object-oriented
programming is best suited for constructing real-world entities. C++, Java, Python,
and other programming languages are examples.
 The easiest way to create logic with a complicated symbol structure is to use logical
programming.

o For example, Prolog, F-logic, and others.

74

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Because various programming challenges necessitate different approaches, a good


programming language should allow many paradigms. If a programming language only
supports one or two paradigms, it may be insufficient or lack features. Multi-paradigm
languages like as C++, C#, Python, Go, and others are supported by the majority of current
languages (Tutorialstonight,2021).

Types of Programming Paradigms,

 Imperative programming paradigm.


 Declarative programming paradigm.

Procedural programming.
In these paradigms, programs are performed step by step by modifying the program's
present state.
An imperative program is made up of commands that the computer executes in order to
modify the program's state. Imperative programming is concerned with how a program
works, as opposed to declarative programming, which is concerned with what the program's
end result will be (Tutorialstonight,2021).

75

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Procedural programming has the following characteristics:

 A top-down method is used in procedural programming.


 The program is organized into functions, which are blocks of code that each execute
a specified purpose.
 Real-world processes are modeled as 'procedures' that operate on 'data' in procedural
systems (Solsarin,2021).

C.
C++.
Java.
PHP.
Rugby.
Scala.
Pascal.
These programming languages support procedural paradigm (Solsarin,2021).

Advantages/ disadvantages of procedural,


Advantage,

76

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

 It's easy to set up and visualize manually.


 Control flow statements are used.
 It's simple to read and understand.

Disadvantage,

 Unable to tackle problems of a complicated nature. Programs cannot run in parallel.


 Less productive, it's harder to deal with today's issues.
 More chances of making a mistake (Solsarin,2021).

Features of procedural programming,

77

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

1. Variables that affect the entire world: A global variable is a variable that may
be read by any other process running in the program, and it can also be
accessed by any other task operating in the program. The majority of the
time, a global variable is a static variable with a scope that spans the whole
program's execution.
2. The parameter is being passed: Variable values can be sent through to the
application, which will handle it using a procedure, using parameter passing.
3. Modularity: Modularity is a software strategy that divides functionality into
individual, replaceable modules, each of which can do the unique task for
which it was created. These all work together as separate jobs to reach a
common aim.
4. Libraries for programmers: Programming libraries are a collection of ready-
to-use scripts, routines, subroutines, classes, and variables that the program
and its users may access at any time.
5. The paradigm of procedural programming: Structured programming gives
rise to procedural programming. Procedures, sometimes known as methods,
functions, routines, or sub-routines, are essentially a set of computer
procedures that must be followed. Procedures can be performed at any
moment within the program, and other procedures may call out another
procedure during its cycle of execution (Sites.google,2020).

Object-oriented programming,

78

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Object Oriented Programming (OOP) is a programming paradigm that uses classes and
objects. It's utilized to break down a software program into reusable code blueprints (called
classes) that may be used to build specific instances of things. Object-oriented programming
languages include JavaScript, C++, Java, and Python, to name a few.
A class is a generic template that can be used to make more specialized, concrete things.
Classes are often used to indicate broad groupings with similar characteristics, such as Car
or Dog. Classes can also have functions known as methods that are exclusively available to

objects of that kind. These functions are specified within the class and execute an action that
is beneficial to that particular object type.

For example, our Automobile class may contain a repaint function that modifies the color of
our car. Because this function is only useful for Car objects, we declare it as a method
within the Car class (Educative.io,2020).
Advantages of OOP,

 Complex things are modeled as repeatable, simple structures in OOP.


 OOP objects are reusable and can be utilized in multiple programs.
 Polymorphism allows for class-specific behavior.
 Classes are easier to debug since they generally contain all relevant information.
 Encapsulation secures and safeguards information (Educative.io,2020).

79

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Disadvantages of OOP,

 The length of programs written in the OOP language is significantly greater than that
of programs written in the procedural technique.
 As the program grows in size, it takes longer to execute, resulting in slower program
execution.
 Because OOP is not a universal language, we can't use it everywhere.
 It is only used when absolutely necessary. It is not appropriate for all types of issues.
 Because using OOP is a little challenging, programmers must have excellent design
and programming skills, as well as adequate planning (Geeksforgeek,2022).

Features of OOP,

1. The emphasis is on data rather than process


2. Programs are broken down into objects.
3. Data structures are created in such a way that they define objects.

80

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

4. Data is concealed and cannot be accessible by external functions.


5. Functions that work on an object's data are coupled together via data structures.
6. Objects communicate with one another via functions.
7. New data and functions can be quickly added as needed - Program design follows a
bottom-up approach (Careerride,2014).

Characteristics of OOP,

 Class definitions: OOP's fundamental building elements and a single entity that
combines data and data operations.
 Objects: are the instances of a class that are utilized in real-world functionality,
including their variables and actions.
 Encapsulation: is a property of a class that binds data and data operations together in
a single unit.
 Inheritance and class hierarchy: Reusability and expansion of existing classes.
 Generic classes: are class definitions for data that isn't provided. Container classes
are what they're called. They are re-usable and bendable (Careerride,2014).

81

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Event driven programming,


Event-driven programming is a programming model in which new user events
(mouse clicks, keypresses), sensor outputs, or message passing from other programs
control program execution. In graphical user interfaces and other programs that
focus on completing user actions in response to user input, programmers employ
event-driven programming (user clicks).
Event-driven programming may alternatively be defined as a method of creating a
computer program in which the primary event loop of the application is clearly
highlighted in the code, with the body of the code consisting of two parts: fetching
the event and event handling. When an event is detected in an event-driven program,
the main loop waits for it and calls a callback function (Studybay,2022).
Event-driven programming is supported in differing degrees by different
programming languages. Complete event support is available in the following
languages:

 JavaScript user actions.


 Perl events and DAEMON daemons and their PRIO priorities.
 Delphi programming language.
 ActionScript 3.0.
 C # events.

Key Features and Characteristics of Event-driven Programming,

82

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

1. 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.

2. Time-Driven.

Time impacted is a paradigm in motivated event programming. Time motivated code differs
from code that runs on a period trigger in that it functions at a defined time, which might be
once an hour, once a week, or once a month. This refers to doing the action from a pre-
determined starting point. For instance, the home windows revision is an example of a time-
driven revision, in which the user may choose when to revise or when to verify and
download the revision.

83

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

3. Functions of Triggers.

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.

4. Events.

Events in this software include mouse, computer keyboard, and user interface events. This
implies that the user must interact with a program object, such as clicking a button with a
mouse, selecting a button with the computer keyboard, and so on.

5. The Ease of Development and the Simplicity of Programming.

Because it is extremely attractive, event-driven programming is simple and much easier to


develop than other types of programming. You can, for example, choose a button and drag it

84

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

onto a form, then create a code for it. The user may also easily insert a pre-written code
script into an existing application using event-driven development. It allows the user to halt
the code in the middle of execution. As a result, utilizing event-driven programming to grow
is simple (Studybay,2022).
Advantages of Event-Driven Programming,
Advantages,

 Flexibility.

If a programmer wishes to update something, they can quickly adjust event-driven


programming. This paradigm enables a programmer to create a representation of their
needs. Event-driven programmers can be put together without too many issues, and the code
and design can be simply changed if something goes wrong.

 Graphical Interfaces.

85

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Suitability Event-driven allows the user to pick different tools from the toolbar to construct
what they need immediately, such as buttons, radio buttons, and so on. This also enables
users to place things where they want them and edit them immediately. Some individuals
find it simpler to alter something by simply clicking on it.

 Natural Dividing Lines.

Are Simple to Locate It is simple to find natural dividing lines for unit testing infrastructure.

 Easily decomposable.

It decomposes quickly.

 Simple and easy to comprehend.

86

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

For both sides of the DevOps Bridge, it provides for a very clear and understandable
paradigm.

 Using Hardware Interrupts.


 Allows sensors and other hardware (Benchpartner,2021).

Disadvantages,

 Complex.
 Less logical and self-evident.
 Error is difficult to locate.
 Slower.
 Confusing.
 Coupling that is too tight.
 Blocking (Benchpartner,2021).

87

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Relationship between programming paradigms similarities and dissimilarities,


A program and its subprograms are defined as a set of stages in procedural programming.
Declarative programs, on the other hand, attempt to explain the outcome without respect to
the procedures used to computerize it, instead of providing a description or denotation of the
desired result.
Encapsulation, inheritance, substitution, programming to interfaces, and other ideas of object-
oriented programming are used to organize code. Object-oriented programming is often
procedural in nature.
Writing event handling routines and having the fundamental event loop provided by the
underlying system is what event-oriented programming is all about. This saves you the hassle

of building your own event loop and allows you to take advantage of numerous libraries that
already work with the system's event loop. Event-based applications are frequently, but not
always, written in an object-oriented paradigm.
These three groups are thus not technically hierarchical, although they are typically nested
inside one another in common usage.
From start to completion, a procedural is written as a series of steps that occurs one after
another.
Object-oriented programming is the process of creating an object and the actions it can do,
and then having other objects inherit those functions to create new objects that contain the
prior objects.
When you declare what happens when something happens, and the software only executes IF
and WHEN that event occurs, you're using event-driven programming.
Simply put, procedural programming is the only way to program. The event-driven and
object-oriented approaches simply assist programmers in managing the complexity of huge
applications.

88

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Programs may easily grow to be hundreds of thousands of lines of code in size. COBOL and
other older programming languages dealt with this complexity by allowing the creation of
paragraphs or by moving some code to external programs that can be called from a main,
central, or controlling program that assigns values to variables that will be used as parameters
by the called program. On termination, the called program would relinquish control to the
caller program and may or may not return some values as specified. When a called program
calls another sub-program with or without arguments and may or may not get a return value,
it is referred to as a nested calling.
When software design and development are allocated to a big number of programmers who
may be scattered across numerous locations, this process seems straightforward but may
become exceedingly unpleasant and unmanageable.
Simply said, event-driven programming makes use of event handlers to maintain a significant
amount of code on hand and is ready to use as needed. If this code is not required, it just sits
on the sidelines, without interfering with or cluttering the other code. Now the program is a
collection of subprograms, each of which is responsible for a discrete and distinct event such
as a comma button, drop-down list, or text box. The controlling software (for example, a
form written in Visual Basic) simply keeps track of various events and executes the code
stored in the event handler designated for that event.

Object-oriented programming combines procedural and event-driven programming skills and


takes them a step farther. A module's functions and variables are stored in an object. Objects
ant just appear out of nowhere. Each object is the result of a class. A class is an object-
creation blueprint, design, or architecture. A class is a container for a large number of
functions. Variables can be found in both a class and its functions. Other functions, variables,
and so forth can be encapsulated within a function. It's the same reason that a smart doctor

89

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

would suggest a drug that comes in capsules rather than a large bottle or box. Other classes
can be used to construct new ones. This is referred to as inheritance. A function or variable
belonging to one object might have the same name as another object's function or variable.
Polymorphism is the term for this. Objects produced from classes interact in a disciplined,
well-defined, and organized manner with the primary, controlling function as well as other
functions, variables, and objects (Quora,2018;2020).

Event-Driven Programming vs. Object-Oriented Programming,


User-produced events, system events in the operating system, and software events created
by the application are all examples of vents. Event-driven programming is a progression of
top-down design concepts in which the program's reactions to various events are
increasingly decided and described.
Object-oriented programming combines the greatest principles from structured
programming with strong new notions to arrange programs in the most efficient way
possible. Object-oriented programming lets you break down an issue into its constituent
pieces. Each component is turned into an independent entity with its own set of codes and
data. The entire technique is simplified in this instance, and the programmer may work with
considerably larger applications (Studybay,2022).

90

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

91

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

92

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

93

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Activity 3

Write suable algorithms for vehicle tariff calculation for rents and hires. Ideally 3
functions should be developed for this purpose as above. Use the visual studio IDE
(using C#.net) to Implement the above algorithms and design the suitable database
structure for keeping the tariffs for vehicle types and different packages which must be
used for implementing the above functions.

94

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

95

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

96

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Analyze the features of an Integrated Development Environment (IDE) and explain


how those features help in application development. Evaluate the use of the Visual
Studio IDE for your application development contrasted with not using an IDE.

What is and IDE,


An IDE, or Integrated Development Environment, allows programmers to combine the
various parts of building a computer program into one convenient location.
IDEs boost programmer productivity by merging common software development tasks such
as editing source code, creating executables, and debugging into a single application.
As well as Throughout the development, building, and testing of software code, developers
employ a variety of tools. Text editors, code libraries, compilers, and test platforms are all
common development tools. A developer without an IDE must choose, deploy, integrate, and
manage each of these tools separately. An IDE is a framework, application, or service that
combines many of these development-related tools into a single framework, application, or
service. The integrated toolset is intended to make software development easier by detecting
and reducing coding errors and typos.
Some IDEs are free and open source, while others are for a fee. An IDE can be purchased
separately or as part of a bigger solution (Codeacademy,2019; Techtarget,2018).

Common features of integrated development environments,

97

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

In the code editor, the user writes and modifies source code. The compiler converts the
source code into a machine-readable language that can be executed. The debugger, on the
other hand, examines the software for any flaws or defects. Programmable editors, object
and data modeling, unit testing, a source code library, and build automation tools may all be
found in an IDE.
The toolbar of an IDE resembles that of a word processor. Color-based categorization,
source-code formatting, error diagnostics and reporting, and intelligent code completion are

all made easier with the toolbar. A developer or a team of developers can compile and run
code incrementally and manage changes to source code in a consistent manner using an
IDE's interface. Third-party version control libraries, such as GitHub and Apache's
Subversion, are commonly integrated with IDEs. Model-driven development can be aided
by an IDE (MDD). A developer using an IDE begins with a model, which the IDE then

converts into appropriate code. After then, the IDE automates the debugging and testing of
the model-driven code. The build can be distributed for additional testing once it has been
successfully completed and thoroughly tested.
Benefits of IDE,
Software developers can increase their productivity by using an IDE since it allows them to
quickly set up and standardize their tools.
Without an IDE, developers waste time determining which tools to use for certain tasks,
configuring them, and learning how to use them. A single integrated development
environment contains many, if not all, of the essential dev-test tools.
The different types of IDEs and the tools that are available,

98

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Developers must choose an IDE that is appropriate for the type of application they wish to
create. If a developer wants to make an iOS app, for example, they'll need an IDE that
supports Apple's Swift programming language. Web-based and cloud-based IDEs, as well as
mobile, language-specific and multi-language IDEs, are all available.

Web-based IDEs are ideal for developing web-based applications in HTML, JavaScript, or
other programming languages. A web-based IDE with capabilities including a code editor,
syntax highlighting, code completion, and debugging is Microsoft's Visual Studio Code.
IDEs are increasingly being delivered via a platform as a service (PaaS) architecture. Access
to software development tools from anywhere in the globe, on any compatible device; low
to nonexistent download and installation requirements; and ease of cooperation among
geographically dispersed developers are just a few of the advantages of these cloud-based
IDEs. Cloud9 is an AWS-provided integrated development environment that supports up to
40 languages, including C, C++, Python, Ruby, and JavaScript. Cloud9 provides code
completion, an image editor, and a debugger, as well as support for Microsoft Azure and
Heroku deployments (which is a cloud-based PaaS IDE). An IDE for mobile development is
often used to build code for iOS or Android devices. Xamarin is a cross-platform mobile
IDE, which means it can write code for a variety of different mobile platforms. A developer
may create a feature in C, for example, and Xamarin will convert it to Swift for iOS and
Java for Android. Xamarin also provides user interface tests and may deliver beta tests to
users.
C-Free, for example, is a language-specific IDE that includes a code editor, debugger, and
environment for running C and C++ programs. Other IDEs, such as the aforementioned

99

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Cloud9 and Visual Studio Code, allow several languages. NetBeans, Eclipse, and IntelliJ
IDEA are some of the more popular IDEs (Techtarget,2018).
Main components and features of IDE,

 Editor for text A text editor for writing and manipulating source code will be
included in almost every IDE.
 Debugger. Users can utilize debugging tools to help them find and fix issues in their
source code.
 Compiler.
 Finishing the code
 Language support is available.
 Plugins and integrations are two types of software that can be used together
(Easierwithpractice,2020).

What is Visual Studio IDE,


A feature-rich tool that covers several elements of software development is known as an
integrated development environment (IDE). The Visual Studio IDE provides a creative
starting pad for editing, debugging, and building code, as well as publishing an app.

100

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Visual Studio's Evolution: The initial version of Visual Studio, dubbed Visual Studio 97 and
bearing version number 5.0, was published in 1997. Visual Studio 15.0 was published on
March 7, 2017, and it is the most recent version. Visual Studio 2017 is another name for it.
The was backed. In the most recent version of Visual Studio, the Net Framework versions
range from 3.5 to 4.7. Java was supported in previous versions of Visual Studio; however, it
is no longer supported in the most recent version (Geeksforgeeks,2019).
There are 3 editions of Microsoft Visual Studio,
Community: In 2014, it was announced that a free version will be available. The rest of the
editions are compensated. This edition has features that are similar to the Professional
edition. Any independent developer may create their own free or paid apps using this
edition. There are several types of apps, including net applications, web applications, and
others.
Visual Studio Professional: is the commercial edition of the software. Visual Studio 2010
and subsequent versions include it. It features tools like Server Explorer and interaction
with Microsoft SQL Server, as well as support for XML and XSLT editing. This edition is
available for a free trial period, after which the user must pay to continue using it.

Enterprise: It's a fully integrated, end-to-end solution for teams of any size with high-
quality and scalability requirements. This edition comes with a 90-day free trial from
Microsoft, after which the user must pay to continue using it. This edition's key advantage is
that it is very scalable and produces high-quality software (Geeksforgeeks,2019).
Features of Visual Studio IDE,

 Editor for code:

101

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Visual Studio features a code editor that enables syntax highlighting and IntelliSense code
completion for variables, functions, methods, loops, and LINQ queries, much like any other
IDE.
When designing web pages and web applications, IntelliSense is enabled for the featured
languages as well as XML, Cascading Style Sheets, and JavaScript. In a modeless list box
above the code editor window, near the editing cursor, autocomplete recommendations
show. It can be briefly semi-transparent to see the code obscured by it in Visual Studio 2008
and later. All supported languages use the code editor.

 Debugger:

Visual Studio comes with a debugger that may be used as a source-level and machine-level
debugger. It supports both managed and native code and may be used to debug programs
developed in any Visual Studio supported language. It also has the ability to attach to
running processes, monitor, and debug them. If the running process' source code is
accessible, it displays the code as it is executed. It can display the disassembly if the source
code is not accessible.

 Designer:

102

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Visual Studio comes with a slew of visual designers to help with app development. These
are some of the tools.

 Browser with Multiple Tabs


 The open tabs browser:

is used to view and switch between all open tabs. CTRL+TAB is used to start it.

 Properties Editor:

The Properties Editor tool in Visual Studio is used to modify properties in a GUI window. It
provides all accessible properties for all objects, including classes, forms, web pages, and
other things (both read-only and settable).

103

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

 The Object Browser:

is a Microsoft.NET namespace and class library browser. It may be used to traverse


managed assembly namespaces (which are organized hierarchically). The file system
organization may or may not be reflected in the hierarchy.

 Solution explorer:

A solution is a collection of code files and other resources needed to construct an


application in Visual Studio. A solution's files are organized hierarchically, which may or
may not correspond to the file system's organization. The Solution Explorer is where you
manage and view your solution's files.

 Sever explorer:

104

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

On a machine that is accessible, the Server Explorer program is used to manage database
connections. It may also be used to access and use data from running Windows Services,
performance counters, the Windows Event Log, and message queues.

 Mapping designer:

LINQ to SQL uses the mapping designer to construct the mapping between database
schemas and the classes that encapsulate the data starting with Visual Studio 2008.
ADO.NET Entity Framework, a new ORM approach solution, replaces and enhances the
previous technology (Wikipedia).

What happens if not use IDE when building a system?


It's something along the lines of create code, compile if required, test, run your code through
lint or plying if you're experiencing issues, and repeating. If anything has gone horribly
wrong, use a debugger. Syntax highlighting is available in modern editors like vim, which
often highlights syntax problems right away.
This is not difficult, but it does need some knowledge and discipline. After a certain amount
of programming, you reach a point where the code works rather well even after it has been
modified. Maybe a few minor tweaks. However, issues are easily resolved.
As simple the actual workflow isn't that dissimilar. You open a code editor because you need
to make changes to your code. You'll need to compile it, so you'll use the right compiler
parameters. You'll need to link it to libraries; therefore, you'll use the linker with the right
parameters. You need to debug it, so you open the debugger and configure breakpoints,

105

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

single-step, and other features. You open the profiler because you need to profile the code.
Rinse and repeat as needed. An IDE simply brings everything together in

one place, and may save/hide some compiler and linker parameters unless you require direct
access to them. The IDE is designed to boost productivity, but if you've worked with
separate development tools and their numerous features before, the gains may not be as
large as you anticipate. Don't get me wrong: I'm a big believer in the power of positive
thinking I enjoy using integrated development environments (IDEs) and do so frequently.
When they're not accessible for a given set of tools, though, I'm quite happy to use the
individual tools.
Long before the advent of IDEs, a great deal of software development took place. And even
if an IDE for a needed mix of development tools isn't available today, software development
continues (Quora,2021).
Using IDE for develop a system,
You'll need to create a variety of items that interact with one another, including code, UI,
project structure, environment configurations, and more. Efforts to make the software
development process easier have resulted in a plethora of software tools that help with a
variety of design and development tasks. An integrated development environment is one
such set of tools (IDE). If you're looking at integrated development environments, you're
probably a seasoned programmer.
Otherwise, a low-code development platform or a no-code development platform might be a
better fit. These tools offer more drag-and-drop features than a real IDE, which includes
code editors as well as development tools like compilers, auto-completion, class
exploration, and hierarchy diagrams. They give almost all of the tools a programmer
requires to construct and build a program from start to finish. While operating their apps,

106

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

developers utilize an IDE to write, manage, and execute code. It simplifies the development
process by separating distinct components of code editing into separate apps (G2,2021).

Activity 4

107

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Design and build a small system to calculate vehicle hire amounts and record them in a
database for customer billing and management reporting for Ayubo drive. This
includes the completing the database design started in 3.2 and implementing one or
more GUIs for vehicle, vehicle type, and package add/edit/delete functions. It
essentially requires an interface for hire calculation and recording function described
above. Generating customer reports and customer invoices are not required for this
course work.

108

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Explain debugging process and the features available in Visual studio IDE for
debugging your code more easily. Evaluate how you used the debugging process to
develop more secure, robust application with examples.

What is debugging,
Debugging is the systematic process of discovering and eliminating computer program
defects, mistakes, and anomalies using debugging tools. Professionals are adopting crucial
components of the process such as intensive testing, upgrading, troubleshooting, and
maintenance as they design software systems.
Normally, the software has mistaken and defects that are fixed on a regular basis. To
discover and correct errors, full software programs are frequently compiled and performed
during the debugging process. Large software applications with millions of lines of source
code are broken down into smaller components. To save time, each component is debugged
independently first, followed by the entire program. In general, how debugging works is
determined by the global testing methodologies employed. Debugging is a useful barometer
for how we generate technologies in general since it is a basic aspect of code handling and
software development. It represents what we've been able to do with programming
languages in the age of digital automation and artificial intelligence. Debugging advances in
lockstep with the technology we use to create and build programs, to put it another way.
Debugging is typically described as involving "people, procedures, and systems" that will
assist in resolving any issues with an existing code base. So how this works varies

109

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

depending on the era: for example, debugging in bare-metal settings on linear, non-object-
oriented programs in the early days of the PC would differ from debugging now.
The emergence of current procedures known as "reverse debugging" is a great illustration of
this.
Reverse debugging, in the age of Develops and agile software development, entails
monitoring programs and giving data in certain ways in order to automate the debugging
process. Individual computer scientists used to perform this in a method that looked a lot
like technical detective work.
In the old days, programmers would write separate tickets after discovering a functional
fault during testing, then go back and sift through the code with now-rudimentary debuggers
to figure out what was wrong. Even a seasoned team might get "stumped" for a long, either
due to the complexity of the code that caused the problem, the elusiveness of the bug in
testing, or both.

Reverse debugging systems, on the other hand, are designed to follow programs in real-time
or otherwise monitor programs in order to supply the proper information and make
debugging more of an automated process, similar to the design of flight recorders in aero
planes. Reverse debugging tools will detect more of the subtleties that computer scientists
would have to study on their end if they did more sophisticated monitoring in real-time or as
programs are utilized. Testing has also altered, with certain CICD and associated procedures
requiring engineers to perform some testing and others requiring end-users to perform
testing in a production environment, beta, or elsewhere in the pipeline. Finally, debugging
will remain an important element of maintaining a codebase (Techopedia,2020).

Importance of debugging,

110

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

If it's been debugged, it promptly reports the mistake. It delivers essential data regarding
data structures in an easy-to-understand style. It aids the developer in the removal of
irrelevant and distracting data.
Setting breakpoints, stepping over, and stepping into functions that are being utilized can cut
development time in half. Debugging not only saves time during development, but it also
helps you better understand your code's logic and flow system—this isn't the major benefit
of debugging, but it's a nice side effect.
Debugging is essential on a variety of levels. Debugging is, in some ways, a euphemism for
"coding" or "creating a program." The thing is, with programming, anything operating on
the first try or being faultless the first time is paradise or the best-case scenario. It is nearly
certain that it will never happen. Because it's just not possible to properly comprehend an
issue in terms of hundreds of lines of code, even if you can conceptualize it and reduce it to
its most basic states. It could be true for little details, but in a larger enterprise, that will
never be the case.
There are accounts and anecdotes of people who manage multimillion-dollar businesses and
products whose code, when properly evaluated, turns out to have hundreds of catastrophic
defects. Now, depending on the type of goods, this may or may not be important. Some
consumers don't mind if there's a minor issue in their application or anything - you know -
yet for others, a bug might be a deal breaker (Bitlapstudio,2018;Datacyper,2020).
Steps of debugging,
Identifying the issue and preparing a report
Assigning the report to the defect's software engineer to ensure that it is real.

Modeling, documenting, discovering and testing candidate defects, and so on are all used in
defect analysis.
By making the necessary adjustments to the system, defects can be resolved.

111

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Corrections are validated.

Features available in Visual studio for debugging.

 . Step Out of the Current Function,

So, you've built a function call that looks something like this:

Figure 12: VS Debug features (source; Cp programming).

Furthermore, the compute average function does not deliver the desired result. You could
put a breakpoint within compute average if you were using a debugger and wanted to step
into it, but what if it was called from many places? The debugger in Visual Studio includes a
very handy function that allows you to easily step into compute average.

112

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

 Set a breakpoint on that line:

Figure 13: Vs debug fea(Source: Cp programming).

Step into the function once the debugger has hit it. Before compute average, both get Sum
and get Count will be called. Normally, you'd keep pressing next to exit get Sum and get

113

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Count, but with Visual Studio, you can rapidly exit the current function and return to the
next call by pressing Shift-F11

Figure 14: Debug fea (Source: Cp programming).

You'll be transported back to the original breakpoint after you exit the current function.
However, you can now re-enter to proceed to the next function. Repeat until you've found
the function you're looking for.
Obviously, there are situations when simply setting a breakpoint in your target function
makes more sense. But it might not be worth it if it means ignoring hundreds of calls to that
function in order to get the one you want. Step out allows you to quickly enter a function
without having to first locate it and set a temporary break point (or use run to cursor).

114

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

 Use the Auto Window to See Result of Functions:

Sometimes programmers may create code like this to get around a problem:

Figure 15: debug fea(Source: Cp programming).

(Obviously, the software writes out the value in this situation, so all is not lost.) In most
cases, this isn't the case.) Thankfully, the vehicles window has the decency to show the
outcome of a function evaluation:

115

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Figure 16: debug fea(Source: Cp programming).


Whenever you need to know what the return value is! Keep in mind that as you execute
code, the autos window will eventually remove the return value, so double-check your
return value right away.

 Run to Cursor:

Run to cursor is a wonderful approach to avoid the step-step-step-step-step-oh-no-I-


stepped-over-its dilemma, where you know where you want to go but having to walk
numerous times to get there makes you frustrated. Run-to-cursor is essentially simply a
shortcut for establishing a breakpoint that is quickly cleared once it is reached; yet, it is a
highly useful function. It's particularly beneficial when you've got a piece of code that

gets called a lot from multiple locations and you just care about one code route. Then you
can put a breakpoint at the beginning of the route and use run-to-cursor to get to the part

116

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

you're interested in. To get into compute average in our sample program, we may use run-
to-cursor instead of the step-out approach. (Of fact, we could just put a breakpoint in
compute average; but, for the sake of this example, assume 15-20 calls to compute
average that all function well, occurring before the faulty call.)

117

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Figure 17:debug fea(Source: Cp programming).

When you need a quick breakpoint or don't want to go through a lot of code in a single step.
However, make sure you're running to a section of the code that will be used. Early returns
from a function inside a loop, for example, should be avoided.

 Modify Any Variable:

Now that we've arrived at the compute average function and determined that the value
returned is far too large, we can examine the function's parameters. That sum turns out to be
quite significant. We'll get to it in a minute. First, let's check to see if the function works if
we obtain the correct value.

118

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Passing in a new value is obviously one method to accomplish this. However, Visual Studio
makes it simple to update any value in memory. In reality, let's try it with the total value and
see whether it yields the proper result. Simply modify the value in the Value column of the
auto or watch window. (You may also accomplish this by hovering over a variable in the
source code and seeing the variable's value come up.)

Figure 18:debug fea (Source: Cp programming).

Continuing to run the application reveals that we are still getting the erroneous answer—this
time, the value 1 is returned. This indicates that truncation is occurring as a result of integer
division.

Figure 19:debug fea(Source: Cp programming).

119

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

This technique is effective, and it's especially useful when you've discovered one error but
still need to verify that the remainder of your code works. This is especially useful if your
debugging session involves a lot of setups—for example, if you need to do a lot of UI to
acquire the appropriate inputs or if your code takes a long time to develop. (Another option
is to write a unit test that shows the problem but does not require as much preparation.)
However, you can't use this method when you're within a loop or a function that's called
frequently—simply it's too inconvenient to have to manually set variables all the time.

 Set Next Statement:

The Set Next Statement is an extremely useful feature. You can occasionally "unwind"
execution if you're debugging and you've mistakenly (or not so unwittingly) stepped past
the point when anything interesting happens. What this truly implies is that you may tell
Visual Studio to go back and start executing from a prior command while keeping the
current state of the environment.
You may also use the set next statement to go beyond a conditional test on an if statement to
execute a route of code that you wish to debug without having to make the condition true. If
the stack or registers aren't in the correct state for the line being run, setting the next
statement can be risky and unstable. And, because it won't restore the world's state,
modifying the next sentence might not be beneficial if your code relies on it. On the other

120

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

hand, if you want to make a choice that you're very certain won't go wrong, it may be a
wonderful method to prevent repeating a specific failure just because you stepped too far .

Figure 20:debug fea (Source: Cp programming).

It may be incredibly easy to be able to just say, Ok, let's do that again, if you had mistakenly
run too far.
Figure 21:debug fea(Source: Cp programming)

121

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

After that, you may repeat the loop, perhaps changing the value of total to 0 because it
wasn't initialized, and checking to see if the program returns the right sum (in which case,
you can be pretty confident that the lack of initialization was the problem).

Figure 22:debug fea(Source: Cp programing).

Many of the same issues apply as they do when reset variable values. However, the further
ahead or back in a function you place the next statement, the less likely the debugger will be
able to adapt, and your program may crash. This approach is frequently used to skip over

relatively tiny sections of code or to return to a single prior function call


(Cpprogramming,2019).

122

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Outline the coding standards you have used in your application development.
Critically evaluate why a coding standard is necessary for the team as well as for the
individual.

What mean by coding standards?


The Coding phase codes the various modules described in the design document according to
the module specifications. The major purpose of the coding phase is to write code in a high-
level language based on the design document created during the design phase and then unit
test it.
Code standards are a well-defined and uniform style of coding that good software
development businesses expect their programmers to adhere to. They frequently create their
own coding standards and rules based on the sorts of software they build and what best
serves their company. Maintaining coding standards is crucial for programmers; else, code
will be rejected during code review (Geeksforgeeks,2019).

Coding Standards Have a Purpose:


The codes created by various engineers have a uniform look thanks to a coding standard.
It enhances the code's readability and maintainability, as well as lowers its complexity.
It facilitates the reuse of code and the detection of errors.
It encourages good programming habits and helps programmers work more efficiently.
Coding Guidelines Have Benefits:
Coding standards improve the software's efficiency and speed its development.
Coding rules aid in the early detection of faults, lowering the software project's additional
costs.
When coding rules are followed, the software code becomes more readable and
understandable, lowering the code's complexity.
It cuts down on the software's hidden costs.

123

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

The following are some of the coding standards:

 Limited usage of global: These rules specify which types of data are allowed to be
declared global and which are not.

 Common headers for different modules: The headers of distinct modules should follow a
standard structure and information for easier understanding and maintenance of the code.
The header format must have the following items, which are often utilized in different
companies:

The module's name


Module creation date
The module's creator
History of changes
The module's synopsis describes what the module performs.

124

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

The module supports a number of functions, each with its own set of input and output
parameters.

Module-accessible or modifiable global variables.

 Local variables, global variables, constants, and functions use the following naming
conventions:

The use of variables with meaningful and intelligible names makes it easier for everyone
to understand why they are being used.
Local variables should be named in the camel case, with a tiny letter at the beginning (e.g.
local data), but global variables should be named with a capital letter (e.g. Global Data).
Only capital letters should be used to construct constant names (e.g. CONSDATA).
It's preferable to avoid using digits in variable names
The function names should begin with tiny letters and be written in camel case.
The function's name must clearly and succinctly convey why the function is being used.

125

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Indentation: To improve the readability of the code, proper indentation is critical. White
spaces should be used appropriately by programmers to make their code understandable.

Between two function parameters, there must be a space following the comma.
Each nested block must be indented and spaced correctly.
At the start and conclusion of each program block, proper indentation should be used.
All braces should begin on a new line, as should the code after the braces.

 Error return values and exception handling conventions:

To make debugging easier, any methods that encounter an error situation should return a
0 or 1.

Coding guidelines, on the other hand, provide some basic recommendations for coding
style to be followed in order to improve the code's understandability and readability.

 Use an easy-to-understand code style:

126

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Easy-to-understand code is essential. Maintenance and debugging are complicated and


costly due to the sophisticated code.

 Avoid using the same identifier for different purposes:

Each variable should have a descriptive and meaningful name that explains why it is
being used. When one identifier is used for several reasons, this is not feasible, and the
reader may become confused. Furthermore, it makes future upgrades more difficult.

 Code should be thoroughly documented:

Code should be well-annotated so that it is easy to comprehend. The code becomes more
understandable by adding comments to the statements.

 Avoid using the GOTO statement:

127

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

Using the GOTO statement causes the program to become unstructured, making it
difficult to comprehend and debug (Geeksforgeeks,2019).

why coding standards are important for a team as well as individual developer.

Increased homogeneity is one technique to reduce complexity. Everything is more


predictable and structured if everyone does things the same way. It's easier to interpret
code. Variable declarations are made at the usual location, in the usual order, and in the
same and customary manner.
E.g.- For instance, my present workplace has a very particular requirement for declaring
IDs. Like This, they must be capitalized. It irritates me. It's a nightmare. But, all of the
time, everyone does it the same way. It gets to the point where it's entirely predictable.
That's preferable.
Because whenever you work on a piece of code, someone else will need to look at it later,
understand it, debug it, and add a feature. Their lives will be made easier if the
organization has a coding standard in place, removing another barrier to comprehending
the code you developed years ago.
You've hit the most crucial reason, the main one.

128

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

The other main one is part of a team, so instead of dealing with quirky small blocks, the
code seems similar to us all.
Others:
Never add SQL Strings as a security standard,
Don't use null,
for example.
Beliefs: Don't utilize code generators,
for example. To activate the XYZ code generator, precede with 'XYZ_'.
While the establishment of coding standards has the potential to be extremely beneficial,
it also has the potential to be quite costly. The establishment of coding standards is
viewed by many software professionals as a theological fight. Their attitude is frequently
expressed as "nobody is going to teach me how to perform my job."
Apart from that, the first step in creating a coding standard is to identify the objectives
that must be met. Are you only attempting to make all of the code appear to have been
written by a single individual, or are you attempting to verify that the code is devoid of
security flaws and/or safety risks? All people working on the standard must have the same
purpose in mind.
Look for established code standards, either inside your firm or on the internet. Starting
with a blank sheet of paper is more difficult than tailoring an established standard.
Every coding standard will need to be verified in some way. You can enforce the standard
by verifying it. If you don't plan on enforcing the standard, you might as well not design it
at all.
Many static analysis tools are available to aid in the verification of coding standards.
Before designing your standard, you might wish to look at the possibilities of such tools.
Automatic coding standard compliance verification is significantly more reliable and less
expensive than manual coding standard compliance verification.

129

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

As straightforward as that,
Code rewriting/debugging/analysis/code review/CI
You can quickly find a solution on the internet because you adhere to a set of rules.
If there is a turnover, you can always recruit someone who is familiar with the standard.
Coding guidelines are created with a few objectives in mind:
Consistency improves the readability of code.
Establishing best practices will help you avoid typical blunders.

And one that is probably underappreciated:


Don't waste time making "8-ball judgments."
Coin-toss decisions would perhaps be a better phrase for the last one. So many aspects of
coding standards appear to be irrelevant (the age-old controversy about spaces vs. tabs
excepted), and they are by making such judgments once and for all, ahead of time, coding
standards (ideally - assuming they're readable, not too lengthy, and coders really
remember them) may save a lot of work.
The risk is that the standards will be so vast or detailed in such a way that writing and
reading them will be a waste of effort. A better way to enforce coding standards is to use
rules built into the developer tools themselves. Linters are built-in to most IDEs and build
tools for this reason. Beyond that, hiring programmers who follow the Golden Rule for
Coding Standards is the most effective approach to maintaining the code clean
(Blog.logrocket,2018;Medium,2019;Multidots,2020);Plesk,2018).

130

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

131

Downloaded by Samzul Mohamed ([email protected])


lOMoARcPSD|14560171

132

Downloaded by Samzul Mohamed ([email protected])

You might also like