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

SampleAssignment

Uploaded by

haroshdilshan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

SampleAssignment

Uploaded by

haroshdilshan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 57

Higher Nationals - Summative Assignment Feedback Form

Student Name/ID

Unit Title

Assignment Number Assessor


Date Received
Submission Date 1st submission

Date Received 2nd


Re-submission Date submission

Assessor Feedback:

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

Pass, Merit & Distinction Descripts P1 P2 M1 D1

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

Pass, Merit & Distinction Descripts P3 M2 D2

LO3. Implement basic algorithms in code using an IDE.

Pass, Merit & Distinction Descripts P4 M3 D3

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

Pass, Merit & Distinction Descripts P5 P6 M4 D4

E19507 Unit – 01 Programming


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

Assessor Feedback:

Grade: Assessor Signature: Date:


Resubmission Feedback:

• Please note resubmission feedback is focussed only on the resubmitted work

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.

E19507 Unit – 01 Programming


2
BTEC HN Summative Assignment Feedback Form
Issue Date: June 2021 Owner: HN QD
DCL1 Public (Unclassified) Version 1.0

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. Avoid using page borders in your assignment body.
3. Carefully check the hand in date and the instructions given in the assignment. Late
submissions will not be accepted.
4. Ensure that you give yourself enough time to complete the assignment by the due date.
5. Excuses of any nature will not be accepted for failure to hand in the work on time.
6. You must take responsibility for managing your own time effectively.
7. 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.
8. Failure to achieve at least PASS criteria will result in a REFERRAL grade.
9. Non-submission of work without valid reasons will lead to an automatic RE FERRAL. You will
then be asked to complete an alternative assignment.
10. 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 intext citation
and a reference list.
11. 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
12. Use word processing application spell check and grammar check function to help editing
your assignment.
13. 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.

STUDENT ASSESSMENT SUBMISSION AND DECLARATION


When submitting evidence for assessment, each student must sign a declaration confirming
that the work is their own.
Student name: Assessor name:

E19507 Unit – 01 Programming


3
Issue date: Submission date: Submitted on:

Programme: Pearson BTEC HND in Computing

Unit: Unit 01 – Programming


Assignment number and title:
Building a Leave Management System for Grifindo Lanka Toys (Pvt) Ltd.
Plagiarism
Plagiarism is a particular form of cheating. Plagiarism must be avoided at all costs and students
who break the rules, however innocently, may be penalised. It is your responsibility to ensure
that you understand correct referencing practices. As a university level student, you are
expected to use appropriate references throughout and keep carefully detailed notes of all your
sources of materials for material you have used in your work, including any material downloaded
from the Internet. Please consult the relevant unit lecturer or your course tutor if you need any
further advice.

Guidelines for incorporating AI-generated content into assignments: The


use of AI-generated tools to enhance intellectual development is permitted;
nevertheless, submitted work must be original. It is not acceptable to pass off
AIgenerated work as your own.

Student Declaration
Student declaration

I certify that the assignment submission is entirely my own work and I fully understand the
consequences of plagiarism. I understand that making a false declaration is a form of malpractice.

Student signature: Date:

Unit 01: PROGRAMMING


Assignment Brief
Student Name/ID
Number
Unit Number and Title Unit 01 – Programming

E19507 Unit – 01 Programming


4
Academic Year 2024/2025
Unit Tutor
Assignment Title Building a Leave Management System for Grifindo Lanka Toys
(Pvt) Ltd.
Issue Date

Submission Date

Submission Format
The assignment submission is in the form of the following.
• The submission should be in the form of an individual written report written in a
concise, formal technical style using single spacing and font size 12. • Student has to
submit the complete GUI System with the database.

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.

LO3. Implement basic algorithms in code using an IDE.

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

Transferable skills and competencies developed

E19507 Unit – 01 Programming


5
Computing-related cognitive skills :
• Demonstrate knowledge and understanding of essential facts, concepts, principles and
theories relating to computing and computer applications
• Use such knowledge and understanding in the modelling and design of computerbased
systems for the purposes of comprehension, communication, prediction and the
understanding of trade-offs
• Recognise and analyse criteria and specifications appropriate to specific problems, and
plan strategies for their solutions
• Critical evaluation and testing: analyse the extent to which a computer-based system
meets the criteria defined for its current use and future development
• Methods and tools: deploy appropriate theory, practices and tools for the design,
implementation and evaluation of computer-based systems.

Computing-related practical skills :


• The ability to specify, design and construct reliable, secure and usable computerbased
systems
• The ability to evaluate systems in terms of quality attributes and possible trade-offs
presented within the given problem
• The ability to deploy effectively the tools used for the construction and documentation
of computer applications, with particular emphasis on understanding the whole process
involved in the effective deployment of computers to solve practical problems
• The ability to critically evaluate and analyse complex problems, including those with
incomplete information, and devise appropriate solutions, within the constraints of a
budget.

Generic skills for employability:


• Intellectual skills: critical thinking; making a case; numeracy and literacy
• Self-management: self-awareness and reflection; goal setting and action planning
• Independence and adaptability; acting on initiative; innovation and creativity

• Contextual awareness, e.g. the ability to understand and meet the needs of individuals,
business and the community, and to understand how workplaces and organisations are governed.

E19507 Unit – 01 Programming


6
Assignment Brief and Guidance:

E19507 Unit – 01 Programming


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

Fn = 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 and carry out an analysis of writing the code phase by discussing the potential
challenges faced.

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
evaluating efficiencies of algorithms. Write the Python program code for the above two
algorithms and critically evaluate their efficiencies using Big-O notation.

E19507 Unit – 01 Programming


8
Activity 2

Compare and discuss


whatis meant by a Programming Paradigm
andthe main
characteristics of Procedural
, Object oriented andt-driven
Even paradigms
and the
relationships among. them
Write small snippets of code as example for
three
the above
programming paradigms using a suitable programming
) andclanguage(s
ritically
evaluate the code samples that you
givenhave
aboveinrelation to
their structure and
theuniquecharacteristics.

Activity 3 and Activity 4 are based


thefollowing
on Scenario.

Grifindo
LankaToys is a small
-scale Toy building companyiswhich
inSri Lanka
and
currently they have
20 employees working
thisatcompany
. Grifindo Lanka Toys is the Sri
Lankan branch of Grifindo Toys Company which is in UK and previously they have hired your
freelance company to develop their payroll system and now they are hiring you again to
develop their leave management system for the Sri Lankan
Grifindo
Lanka
branch,
Toys
Company
.
Specifications forleave
the management
system as follows,

This leave management system has two user roles, and they are
Admin,
Employee
and theyand
are having two separate desktop applications to interact with the centralized
. Developerdatabase
can consider the centralized database
as a local database for the development purposes.

E19507 Unit – 01 Programming


9
E19507 Unit – 01 Programming
10
Functional requirements for the Employee and Admin as follow.

1. Employee Application.

• Employee should be able to login to the system with the employee number and
the given password.

• Employee should be able to apply for a leave through the system.

Note:- Normally an employee has 14 annual leaves, 7 casual leaves for a year and
2 shorts leaves per a month. Employee can apply casual leaves as they want
before their defined roaster starts. Annual leaves can be applied before 7 days
prior to the leave date. Short leave duration is 1 hour and 30 minutes and can be
applied for up coming time slots.

• Employee can view the status of applied leaves (Whether applied leaves are
approved or not).

• Employee can delete applied leaves.

• Employee can view their remaining leaves and history of applied leaves.

2. Admin Application

• Admin should be able to login to the leave management system.

• Admin should be able to register new employees to the system.

• Admin should be able to define the number of annual leaves, casual leaves for a
year and 2 short leaves per every month for every employee. (Newly joined
employees will less number of leaves compared to permanent employees)

• Admin should be able to define the roaster starting time and end time for each
employee.

E19507 Unit – 01 Programming


11
E19507 Unit – 01 Programming
12
• Admin should be able to approve or reject applied leaves of each employee.

• Admin should be able to view leave reports of,

▪ Individual employee leave history for a given date range.

▪ All employees leave history for a given date range.

Activity 3

3.1. Write the complete pseudocode for the employee apply leave function of the
above system. Use the visual studio IDE (using C#.net) to implement the above two
applications. Ideally there should be two separate classes for the above two applications and
the developer can decide the methods which need to include in those classes. Design the
suitable database structure for keeping the data of the above system.

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

4.1 Design and build two small GUI systems for the above scenario and those two applications
should be complete functional systems with all the functions which has described in the
above scenario with the database structure which has designed in activity 3.

4.2 Examine 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 Explain and 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.

E19507 Unit – 01 Programming


13
Reading:
Aho, A. V. et al. (1987) Data Structures and Algorithms. 1st Ed. Addison-Wesley. Hunt, A.
et al. (2000) The Pragmatic Programmer: From Journeyman to Master. 1st Ed.

Addison-Wesley. McConnell, S. (2004) Code Complete: A Practical Handbook of Software


Construction. 2nd Ed. Microsoft Press.

HN Global:
HN Global HN Global (2021) Reading Lists. Available at:
https://hnglobal.highernationals.com/learning-zone/reading-lists

HN Global (2021) Student Resource Library. Available at:


https://hnglobal.highernationals.com/subjects/resource-libraries

HN Global (2021) Textbooks. Available at:


https://hnglobal.highernationals.com/textbooks

E19507 Unit – 01 Programming


14
E19507 Unit – 01 Programming
15
E19507 Unit – 01 Programming
16
Table of Contents
Plagiarism...........................................................................................................................................................
Student Declaration............................................................................................................................................
Unit 01: PROGRAMMING....................................................................................................................................
Table Of Figures............................................................................................................................................
1. Introduction..................................................................................................................................................
Definition of an Algorithm................................................................................................................................
Characteristics of a Good Algorithm.................................................................................................................
Activity 1...........................................................................................................................................................
Algorithms and Characteristics.........................................................................................................................
What is Calculations?........................................................................................................................................
Simple algorithm Example-1 (Defeat a separation).........................................................................................
Here are the primary attributes:...................................................................................................................
Here's the reason it's significant:..................................................................................................................
Differences Between Flowchart and Pseudocode...................................................................................
Factorial capability............................................................................................................................................
Algorithm for Factorial function...........................................................................................................
Steps associated with programming.................................................................................................................
Problem Analysis..............................................................................................................................................
Coding...............................................................................................................................................................
Developers........................................................................................................................................................
Internal process and compilation.....................................................................................................................
Testing..............................................................................................................................................................
Documentation.................................................................................................................................................
Difficulties and arrangements in coding stage..................................................................................................
1. Null Pointer Exceptions..............................................................................................................................
Challenge..........................................................................................................................................................
Solution............................................................................................................................................................
2. Buffer Overflow..........................................................................................................................................

E19507 Unit – 01 Programming


17
Challenge..........................................................................................................................................................
Solution............................................................................................................................................................
Dry run and Big-O notation...............................................................................................................................
Linear Search....................................................................................................................................................
Implementation and algorithm efficiency.........................................................................................................
1. Fibonacci algorithm implementation.........................................................................................................
Fibonacci algorithm testing..............................................................................................................................
3. Fibonacci algorithm pseudocode and implemented code.........................................................................
4. Implemented code and pseudocode for the factororial algorithm............................................................
5. Efficiency of the algorithm (Evaluation).....................................................................................................
Fibonacci calculation effectiveness...................................................................................................................
Factorial capability calculation effectiveness....................................................................................................
2nd Activity.......................................................................................................................................................
Programming ideal models...............................................................................................................................
Procedural programming..................................................................................................................................
Elements of procedural programming languages.............................................................................................
Procedural programming languages' advantages.............................................................................................
Object Oriented Programming................................................................................................................
OOP's Key Concepts..........................................................................................................................................
1. Class A........................................................................................................................................................
2. Object........................................................................................................................................................
3. Syntax...........................................................................................................................................................
1. Encapsulation.............................................................................................................................................
2. Inheritance.................................................................................................................................................
Benefits of OOP................................................................................................................................................
•Increments efficiency in programming improvement:...................................................................................
• Ease of troubleshooting:................................................................................................................................
Programing driven by events............................................................................................................................
1. Occasion Dealing with:...............................................................................................................................
2. GUI Development:........................................................................................................................................
3. Nonconcurrent Execution:.........................................................................................................................

E19507 Unit – 01 Programming


18
4. Event Loop Management:.............................................................................................................................
1. Rule-based:................................................................................................................................................
2. The core part..............................................................................................................................................
3. Non-Successive Execution:.........................................................................................................................
4. Appropriateness for man-made intelligence.............................................................................................
Common Elements of Programming Standards................................................................................................
1. Deliberation:..............................................................................................................................................
2. Information Association:............................................................................................................................
1. Control Flow...............................................................................................................................................
2. Simultaneousness:.....................................................................................................................................
The Benefits and Drawbacks of Programming Models.....................................................................................
1. Procedural Programming -..........................................................................................................................
Benefits:...........................................................................................................................................................
2. Object-Situated Programming (OOP)............................................................................................................
3. Occasion Driven Programming.....................................................................................................................
4. Sensible Programming..................................................................................................................................
5. Information Driven Programming.................................................................................................................
Relationships among Programming Models.....................................................................................................
1. Procedural Worldview...............................................................................................................................
2. The Object-Oriented Approach..................................................................................................................
3. An Event-Driven Approach...........................................................................................................................
3. logical framework......................................................................................................................................
Activity 3...........................................................................................................................................................
What is an IDE?.................................................................................................................................................
The primary elements of an IDE and the advantages of each element for developing applications................
Interpreter:.......................................................................................................................................................
Debugging:.......................................................................................................................................................
Implementation of the System.........................................................................................................................
Screen shots.....................................................................................................................................................
Login Page Code...............................................................................................................................................
Admin Page Coding...........................................................................................................................................

E19507 Unit – 01 Programming


19
Employee Details Page Code...........................................................................................................................
Employee Leave Apply Page.............................................................................................................................
Leave Applying Page Code................................................................................................................................
SQL Server Screen Shots...................................................................................................................................
Activity 4.2........................................................................................................................................................
Describe debugging..........................................................................................................................................
Coding standards:.............................................................................................................................................
Low level of complexity....................................................................................................................................
Indentation.......................................................................................................................................................
Conclusion........................................................................................................................................................
References........................................................................................................................................................

E19507 Unit – 01 Programming


20
Table Of Figures
Figure 1 Pyhton IDLE 1......................................................................................................................................
Figure 2 Python IDLE 2......................................................................................................................................
Figure 3Python IDLE 3.......................................................................................................................................
Figure 4 Pyhton IDLE 4......................................................................................................................................
Figure 5 Login Page 1........................................................................................................................................
Figure 6 Adding Employee Leave application...................................................................................................
Figure 7 Leave Searching page..........................................................................................................................
Figure 8 Leave Staus Viewing page...................................................................................................................
Figure 9 Admin Page 1......................................................................................................................................
Figure 10 Employee Leave apply Query table..................................................................................................
Figure 11 Employee Application query Table...................................................................................................
Figure 13 Leave Sql Query Table.......................................................................................................................
Figure 12 Admin SQL Table...............................................................................................................................

E19507 Unit – 01 Programming


21
1. Introduction

Definition of an Algorithm

An algorithm is a finite set of well-defined instructions to solve a problem or perform a


computation. In simple terms, it is a step wise representation of a solution to a problem. It is
broken down to smaller pieces. Therefore Algorithm is refers to a sequence of finite steps to
solve a particular problem

Characteristics of a Good Algorithm

It should be taken into mind that all written instructions are not algorithms. For some
instructions to be algorithms, it must have certain characteristics
 It should be clear and unambiguous, it should lead to only one meaning
 Well defined inputs
 Well defined outputs
 Efficiency: It should use the least amount of resources, such as time and space.
 Finiteness: The algorithm should terminate after a finite number of steps.
 Clarity: The steps should be easy to understand and implement.
 Feasible: The algorithm must be simple, generic, and practical, such that it can be
executed with the available resources.
 Language Independent: The Algorithm designed must be language-independent, i.e. it
must be just plain instructions that can be implemented in any language, and yet the
output will be the same, as expected.
 General Applicability: It should be applicable to a range of inputs.

E19507 Unit – 01 Programming


22
Activity 1
Algorithms and Characteristics

What is Calculations?
A set of instructions intended to complete a task is called an algorithm. Most of the time,
algorithms take one or more inputs, run them through a series of steps in a systematic way,
and then give you one or more results.
Algorithms are a crucial part of computer programming and are typically associated with
computing. Calculations can be utilized to achieve different computational undertakings,
like performing estimations or tracking down data in data sets. Outside of
programming, algorithms can also be created and used.
They can be done manually by people or automatically by machines.
For example,
you could do long division on paper instead of using a calculator to do the same thing.
Clients don't have to comprehend the internal activities of calculations to utilize them.
Truth be told, numerous calculations utilized by organizations are strictly confidential
mysteries, hindering clients from seeing precisely the way that they work.

E19507 Unit – 01 Programming


23
Simple algorithm Example-1 (Defeat a separation)

1. Acknowledge that you're going through a troublesome time and permit yourself to feel
the feelings.
2. Attempt to keep away from interruptions and live reality likewise give yourself space to
recuperate.
3. Examine the relationship to discover what went wrong and what you can learn from it.
4. Converse with companions, family, or a specialist about your sentiments to assist with
handling the separation.
5. Concentrate on physical and mental well-being-enhancing activities like exercise, hobbies,
or meditation.
6. Avoid unfortunate ways of behaving like unreasonable drinking or separating yourself.
7. Helping you move on with your life, create a new daily routine without her.
8. Recognize new private or expert objectives to concentrate your energy and provide
yourself a feeling of motivation.
9. Advise yourself that mending requires some investment, and that it's a chance for self-
awareness.
10. Progressively free yourself up to new encounters and conceivable outcomes, including
the potential for future.

Step-by-step instructions for completing a task or resolving a problem are known as


algorithms. They are similar to planning charts in that they present an organized sequence of
actions that can be carried out effectively and efficiently to achieve a goal.
For example,
the calculation on the most proficient method to move past a separation gives a rundown of
activities to be taken sequentially from feeling one's aggravation to acknowledging new open
doors ahead so close to home recuperation will be handled with care and accuracy.

The self-care algorithm then goes on to describe every step that would guarantee healing,
including engaging in constructive activities, avoiding destructive coping strategies,
and seeking assistance.
This large number of calculations demonstrate that lucidity and rationale of the guidelines
can turn out subordinate and extremely viable in such a major circle of life.
They are the actual embodiment of critical thinking in the fields of software engineering and
designing, and, surprisingly, in some basic daily existence circumstances;
they work on aiding one handle profound stressing circumstances in a coherent and certain

E19507 Unit – 01 Programming


24
manner. Even in the most advanced fields, algorithms theory can be applied.
For example,
the Transformer brain network calculation, presented by Vaswani in 2017, has reformed the
area of normal language handling by applying self-consideration components.
Then, because it is an effective algorithm for capturing contextual information in large data
sequences, it serves as the fundamental foundation for cutting-edge models like BERT and
beyond.
Qualities of a decent calculation A good algorithm has a few key qualities that make it
effective, dependable, and useful for solving a problem.

Here are the primary attributes:


1. Data sources and Results The inputs and outputs of the algorithm should be specified in
detail.
2. Efficiency It ought to finish the job quickly and without wasting memory or time.
3. Correctness It should deliver the right outcomes for every single imaginable info.
4. Finiteness The algorithm must have a predetermined number of steps before reaching its
conclusion.
5. Clarity The means ought to be clear and straightforward, with no disarray about what
should be finished.
6. Simplicity The algorithm shouldn't be too complicated and shouldn't be hard to
understand.
7. Scalability Even as the size of the input data grows, it ought to work well. The significance
of comprehending algorithms Understanding calculations is significant in light of multiple
factors, particularly in the present innovation driven world.

E19507 Unit – 01 Programming


25
Here's the reason it's significant:
1. Skills for solving problems You learn how to break down complicated problems into
smaller, more manageable steps with algorithms. Your ability to effectively solve
problems is enhanced by this structured approach.
2. Efficiency Choosing the most effective method for completing tasks is made easier when
you understand how algorithms work. This can save time, decrease costs, and improve
assets, whether you're coding, coordinating information, or in any event, arranging your
day.
3. Strengthening in Day to day existence Calculations are not only for PCs — they're all over,
from online web search tools to virtual entertainment takes care of. You can better
control and navigate the technology that affects your daily life if you understand them.
4. Flexibility in Using New Technologies As new advancements arise, many are based on
algorithmic standards. You can quickly adapt to and master new technologies and tools if
you understand algorithms.
5. Further developed Navigation Calculations frequently guide dynamic cycles, from basic
assignments like arranging data to complex frameworks like monetary demonstrating.
Understanding how they work assists you with settling on additional educated choices.
6. Information The executives With the blast of information in different fields, understanding
calculations is vital for productively arranging, looking, and overseeing enormous
datasets. This is key in regions like information science, computerized reasoning, and AI.

E19507 Unit – 01 Programming


26
Differences Between Flowchart and Pseudocode

Pseudocode and a flowchart are two ways to show the control flow of a program, algorithm,
or process through its statements. Pseudocode and the flowchart differ significantly in how
they depict the control flow. The flowchart is a graphical portrayal of a calculation. However,
the algorithm's textual representation is known as the pseudocode. Well, we can use these
ideas together to create software or use them on their own.

Calculations for Fibonacci and Factorial Fibonacci grouping Each number in the Fibonacci
sequence is created by adding the two numbers that came before it. Beginning with 0 and 1,
each ensuing number in the grouping is the amount of the past two. This makes a particular
example: 0, 1, 1, 2, 3, 5, 8, 13, 21, etc.

Calculation for Fibonacci series


Start
Input n (the number of terms in the Fibonacci series)
Initialize numA = 0
Initialize numB = 1

Display numA
Display numB

For i = 3 to n:
nextNum = numA + numB
Display nextNum
numA = numB
numB = nextNum
End while
End

The Fibonacci series is produced by this algorithm up to a certain number of terms,


n.
It displays these initial values after initializing the first two Fibonacci numbers,

E19507 Unit – 01 Programming


27
numA as 0 and numB as
1. After that, it enters a for loop that goes from 3 to n and calculates the sum of numA and
numB for each subsequent Fibonacci number. The values of numA and numB are
updated for the subsequent iteration, and each new number, nextNum, is shown.
A complete Fibonacci sequence up to the specified term count is produced as this
process continues until all n terms are displayed.

Factorial capability
The factorial capability is an essential idea in math, with applications crossing different fields
like math, science, measurements, designing, and software engineering.
It is a useful tool for figuring out how many different options there are for a given situation.
By duplicating all certain whole numbers up to a particular number,
the factorial capability epitomizes the critical standards of stages and blends, making it
fundamental for tackling issues connected with these ideas.

n! = n x (n minus 1) x (n minus 2) x... x 2 x 1

Algorithm for Factorial function

Start
Input n
Introduce result = 1
From n to i = 2:
result = result * I
End For
Display result
End

Show the result End This calculation computes the factorial of a given number n by instating
a variable outcome to 1. It then, at that point, utilizes a for circle to repeat from 2 through n,
duplicating result by each circle list I to gather the result of all whole numbers from 1 to n.
In the wake of finishing the circle, the last worth of result addresses the factorial of n, which
is then shown. The factorial is accurately computed using this straightforward iterative
method.

E19507 Unit – 01 Programming


28
Steps associated with programming

In Software improvement, making a practical and productive program includes something


beyond composing code. It requires a precise way to deal with guarantee the eventual
outcome meets its expected reason as well as keeps up with great and unwavering quality.
Each phase of the programming system assumes a pivotal part in conveying programming
that is strong and successfully addresses client needs.
The crucial stages of the programming process will be examined in this section, with an
emphasis on their significance. This section focuses on the core programming process,
particularly in relation to the Implementation phase, within the larger software development
life cycle, which includes requirement analysis and planning, design, implementation, testing,
documentation, deployment, and maintenance.

Problem Analysis
Issue investigation is a progression of steps for recognizing issues, examining them, and
creating answers for address them. It's a request or examination concerning the reasons for
a mistake, disappointment, or unforeseen episode. While the significant point of issue
examination is to foster arrangements, the cycle likewise furnishes you with a top to bottom
comprehension of an issue that empowers you to forestall different sorts of issues that could
emerge from a similar reason. (Team, 2024s

Coding

What’s exactly is coding and how does it work? We should begin with a coding definition in
straightforward terms. Coding in PCs is the most common way of composing directions for
PCs that we call code. Coding lets humans create instructions that computers can
comprehend and carry out. The coding stage is a basic stage where reasonable plans are
rejuvenated through the improvement of genuine programming code. Software engineers
make an interpretation of these plans into a programming language, holding back nothing is
organized, coordinated, and viable.

E19507 Unit – 01 Programming


29
Developers
benefit from effective collaboration thanks to this methodical approach. Because it improves
user experience, conserves resources, and optimizes performance, writing efficient code is
essential. By zeroing in on lucidity, construction, and advancement, developers can upgrade
programming quality while limiting troubleshooting and upkeep challenges. This approach
not just smoothed out the progress from hypothetical plan to pragmatic application yet in
addition includes changing unique ideas into utilitarian programming arrangements.
In order to carry out the desired functionalities, programmers carefully select the
appropriate algorithms, data structures, and programming paradigms. To guarantee future
scalability, modularity and software architecture are given priority in this procedure.
Version control and extensive documentation facilitate collaboration, and error handling is
integrated to anticipate and manage potential issues during execution.

Internal process and compilation

In the wake of coding, the following critical step is changing the code into machine-
comprehensible directions that the PC can comprehend and execute.
This is where accumulation becomes fundamental. A compiler makes an interpretation of
intelligible code into an organization that is conceivable
to the PC's processor. This indispensable interaction guarantees that the code you've
composed is precisely changed over into directions that the PC can execute productively.

Testing
Testing is a urgent stage that guarantees the program acts true to form and produces exact
results across different information sources.
To find bugs, errors, and unexpected behaviors, comprehensive testing uses a variety of test
cases.
This stage likewise incorporates troubleshooting, which is the method involved with
distinguishing and fixing code-related issues to accomplish the ideal usefulness.
Investigating is fundamental for settling code issues and guaranteeing a dependable
programming item. It requires an organized methodology and different instruments to help
engineers pinpoint and address issues.
Data breakpoints, conditional breakpoints, step-over breakpoints, step-into breakpoints, and
step-out breakpoints all aid in comprehending code flow and spotting deviations from
expected behavior.

E19507 Unit – 01 Programming


30
Documentation
No matter what the program's coding quality, documentation is pivotal for grasping its
objectives, usefulness, and utilization. The program's internal workings can be better
understood by future developers and users thanks to clear and comprehensive
documentation.
To make the program more accessible, this stage includes creating user guides, code
comments, and other relevant documents. Advancing through the phases of programming
from issue examination to documentation lays out an organized structure that guarantees
the improvement of great programming. Programs that are not only usable but also scalable,
user-friendly, and easy to maintain are made possible by each phase.

Difficulties and arrangements in coding stage

1. Null Pointer Exceptions


A Null pointer Exception happens when the code endeavors to utilize an article
reference that has not been introduced (i.e., it is invalid).
This can prompt runtime crashes or erratic way of behaving, as the code is attempting to
get to or control information that doesn't exist.

Challenge
It can be hard to figure out where a null pointer exception occurs, especially in
complicated applications with many interconnected parts.
This blunder frequently brings about accidents or application disappointments, making it
basic to address.

Solution
Implement Null Checks:
Before making use of an object reference, add null checks to ensure that it is not null. For
instance, utilize restrictive proclamations to check that the item is appropriately instated
prior to getting to its techniques or properties. By handling the situation in which the
reference might be null, this stops the exception from happening.

2. Buffer Overflow
When a program writes more data to a buffer—a temporary storage location—than it
can hold, this results in a buffer overflow error. This can overwrite nearby memory,
prompting information defilement, accidents, or security weaknesses.

E19507 Unit – 01 Programming


31
Challenge
Due to the fact that buffer overflows may not manifest immediately, they can be
challenging to detect and diagnose. They can cause capricious way of behaving,
information misfortune, or even security takes advantage of, making them a serious
concern.

Solution
Utilize Safe Support The board Strategies:
Carry out limits checking to guarantee that information kept in touch with a cradle
doesn't surpass its distributed size. Furthermore, utilize more secure capabilities and
libraries that handle cradle measures and forestall spills over,
for example, those that perform programmed limits checking or utilize dynamic memory
the board procedures.

E19507 Unit – 01 Programming


32
Dry run and Big-O notation

Dry run of Fibonacci algorithm


The Fibonacci algorithm is explained step-by-step in this section,
showing how it calculates the Fibonacci sequence up to the fifth number. The objective is to
make sense of the cycle and rationale behind each move toward the estimation plainly.

Step Num Count numA numZ nextNum Display


(Output)
Initial 5 0 0 1 - -
1 5 0 0 1 0+0=1 0
2 5 1 1 1 1+1=2 1
3 5 2 1 2 1+2=3 1
4 5 3 2 3 2+3=5 2
5 5 4 3 5 3+5=8 3
End 5 5 - - 5

The Fibonacci sequence for the number 5 is calculated step by step in this table.
The algorithm calculates nextNum by adding these two values, starting with numA = 0 and
numZ = 1, and then updates numA and numZ accordingly. After the initial display of numA,
the output for each subsequent step is the current numA while the nextNum is computed
and used to update the sequence. This cycle go on until count rises to 5, so, all in all the circle
closes, and the last result showed is the fifth Fibonacci number, which is 5.

E19507 Unit – 01 Programming


33
Dry run of Factorial algorithm

A dry run is a method for understanding how an algorithm calculates a given number's
factorial by going through each iteration of the algorithm sequentially.
Seeing the algorithm's step-by-step progression in this way makes it easier to understand
how the final result is achieved. This approach gives significant bits of knowledge into the
interior operations of the calculation, making it a helpful instrument for both learning and
Debugging.

Step num x x <= num multipliedNum Output


Initial - 1 - 1 -
1 4 1 1 <= 4 1*1=1 -
(True)
2 4 2 2 <= 4 1*2=2 -
(True)
3 4 3 3 <= 4 2*3=6 -
(True)
4 4 4 4 <= 4 6 * 4 = 24 -
(True)
5 4 5 5 <= 4 - 24
(False)

This table frameworks the bit by bit course of ascertaining the factorial of the number 4.
At first, the augmentation begins with multipliedNum = 1.
As the means progress, the calculation duplicates multipliedNum by the ongoing worth of x
(beginning from 1), refreshing multipliedNum each time. For example, in the initial step, 1 * 1
= 1, in the subsequent step, 1 * 2 = 2, etc. This goes on until x is greater than the value of
num (4). The condition x = num is false when x reaches 5, and the output of the loop is the
final factorial value of 24.

E19507 Unit – 01 Programming


34
Big-O notation

Big O documentation is a useful asset utilized in software engineering to depict the time
intricacy or space intricacy of calculations.
It gives you a standard way to compare how well different algorithms work in the worst-case
scenario. Seeing Huge O documentation is fundamental for dissecting and planning
proficient algorithms.

In this instructional exercise, we will cover the essentials of Enormous O documentation, its
importance, and how to break down the intricacy of calculations utilizing Huge O.

Big-O notations and their importance 1.


1. O(1): Consistent time calculation runs in a steady time regardless of how enormous the
information is.For instance, checking whether the primary byte of a record is invalid
(0x00) is steady time;regardless of how enormous the document is, we just have to
investigate the principal byte.Another example is programs that, despite the fact that
solving a given problem might take a very long time, ignore their input and compute the
answer.

2. O(log n): Logarithmic-time calculation runs in time corresponding to the logarithm of the
information. The most widely recognized model is maybe twofold pursuit given an
arranged exhibit (with irregular access) of n components, we can find regardless of
whether a particular thing is in the cluster by utilizing double hunt, separating the hunt
space by half by really looking at the center component.

3. O(n): Direct time calculation runs in time relative to the information. This can be
fortunate or unfortunate: when n is the quantity of components in a variety of whole
numbers, radix arranging permits us to sort it in direct time, a generally excellent
exhibition, however when n is a positive number and we need to check whether it's
prime, doing preliminary division by and large numbers 2,3,… , n −12,3,… ,n−1 is a
lackluster showing.

4. O(n log n): For "reasonable" input, a linearithmic-time algorithm operates in a time that is
not particularly distinguishable from linear-time, and it is frequently encountered in
sorting algorithms. Since linearithmic-time has been shown to be the most efficient

E19507 Unit – 01 Programming


35
running time for comparison-based sorting algorithms (merge sort, heap sort, etc.), many
comparison-based sorting algorithms (merge sort, heap sort, etc.) use it.

5. O(n2): Algorithms with quadratic time take time equal to the square of the input.
Schoolbook multiplication of two n-digit numbers or two polynomials of degree n (faster
algorithms exist, such as Karatsuba's algorithm), some slow sorting algorithms (such as
selection sort and insertion sort), and dynamic programming's solution to the longest
common subsequence problem are examples of algorithms that take this long.

6. O(n3): The running times of schoolbook matrix multiplication, computing determinant


using. Gaussian elimination (which can be done using matrix multiplication), and finding
a triangle a graph with n vertices (which can also be done using matrix multiplication) are
probably the most common cubic-time algorithms. However, there are also faster
algorithms, such as Strassen's algorithm.

Linear Search
Despite the fact that the exhibit/list is arranged or unsorted we think about the
components one - by - one from the first component to until the normal outcome found or
for
the rest of the cluster. We need to look through all components on the off chance that that
normal outcome isn't in the rundown. The intricacy is straightforwardly connected with the
quantity of the data sources - a calculation makes an additional input for each extra

information Model: What number of cycles that you really want to figure out component
25, 11 and 8?

26 11 36 21 5 25 43 79 7 9

E19507 Unit – 01 Programming


36
As per this model, there are 10 components and files from 0 to 9. Figuring out these
components by less fatty hunt are proceeded as follows;

To find component 25 we want to complete 06 emphasess - Normal case.


Two iterations – the best case – are required to locate element 8.
To find component 07 we really want to complete 09 cycles - Assuming the worst possible
scenario.

When we have to locate an element like number 17, it becomes more difficult and worse.
Since then we would look through every one of the components in the rundown to give the
outcome as component isn't found.

Binary Search
The rundown should be arranged. In binary search, we use the
divide and conquer strategy to locate the required output and the middle index.
After locating the middle element, we split the array and re-locate the middle element until
we achieve the desired output. Center list is tracking down through a little estimation as

Mid file = current least record (current most elevated list - current most minimal file)/2

Binary search is more proficient than straight inquiry. On the off chance that, when we are
finding a component through parallel hunt, it produces the result by less measure of
emphases than straight inquiry.

Example: Binary search on previous example.


26 11 36 21 5 25 43 79 7 9

5 7 9 11 21 25 26 36 43 79
(Need to be sorted)

Finding element 25;


mid = low + (high - low)/2
= 0 + (9 - 0) / 2
= 4.5 (4)  21  21! =25

E19507 Unit – 01 Programming


37
25>21: split the array
23 25 36 43 79

mid = low + (high - low)/2


= 5 + (9 - 5) / 2
= 7  36  36! =25
25<36: split the array
25 26

mid = low + (high - low)/2


= 5 + (6 - 5) / 2
= 5.5 (5)  25  25 = 25
03 iterations to find element 25 – Average case
An element which was be a worst case in leaner search become a best case in binary search
as binary search array is sorted. And, based on examples when we are searching for element
25, it took 06 iteration in leaner search but on the other hand it took just 03 iterations in
binary search. So, we can see that binary search is more efficient than leaner search.

Bubble Sort
Basically, in bubble sort, we are arranging the array / list in order. It takes several iterations

E19507 Unit – 01 Programming


38
to complete an array. This is logically easy to handle. But, practically this is complex, not
suitable to get an immediate output and also required many iterations. Totally the efficiency
of bubble sort is lowest. Following example will make much clearer

Example:
34 12 45 22 8 29 57 93 18 4

Iteration 1 –
12 34 22 8 29 45 57 18 4 93

Iteration 2 –
12 22 8 29 34 45 18 4 57 93

Iteration 3 –
12 8 22 29 34 18 4 45 57 93

Iteration 4 –
8 12 22 29 18 4 34 45 57 93

Iteration 5 –
8 12 22 18 4 29 34 45 57 93

Iteration 6 –
8 12 18 4 22 29 34 45 57 93

Iteration 7 –
8 4 12 18 22 29 34 45 57 93

Iteration 8 –
4 8 12 18 22 29 34 45 57 93

This array took seven iterations to sort. Now, its clear that bubble sort or class E has the
lowest efficiency in Big – O notation

E19507 Unit – 01 Programming


39
E19507 Unit – 01 Programming
40
Implementation and algorithm efficiency

1. Fibonacci algorithm implementation

Figure 1 Pyhton IDLE 1

This iterative Fibonacci calculation effectively works out the nth Fibonacci number. As these
are base cases, it checks whether n is 0 or 1, and returns n immediately. It uses two
variables, numA and numZ, to keep track of the previous and current Fibonacci numbers
for larger values of n. The circle emphasizes from 2 to n, refreshing these factors to
iteratively create the succession. After the circle, numZ contains the ideal Fibonacci
number, which is then returned. This approach has a period intricacy of O (n) and a space
intricacy of O (1), making it both basic and effective.

E19507 Unit – 01 Programming


41
Fibonacci algorithm testing

Figure 2 Python IDLE 2

E19507 Unit – 01 Programming


42
2. Factorial function algorithm implementation

Figure 3Python IDLE 3

This iterative factorial capability computes the factorial of a given number n. It begins by
introducing result to 1, then, at that point, emphasizes through all numbers from 2 up to n,
duplicating result by every one of these numbers. The circle actually fabricates the result of
all
numbers from 1 to n, putting away the last factorial worth in outcome. The function returns
result, which contains the computed factorial of n, after the loop has been completed. For
instance, if n = 5, the capability returns 120 since 5! = 5×4×3×2×1=120!

E19507 Unit – 01 Programming


43
Factorial algorithm testing

Figure 4 Pyhton IDLE 4

3. Fibonacci algorithm pseudocode and implemented code

The Python code for the Fibonacci series intently follows the pseudocode, beginning by
instating the factors numA, numZ, and nextNum. After that, it makes use of a loop that
repeats
itself n times, updating nextNum with the sum of numA and numZ on each subsequent
iteration
while effectively shifting the values between these variables. In addition, the code optimizes
by
initializing resultArray to store the values of the Fibonacci series. This is a good practice for
effectively managing the sequence throughout the iterations and keeping track of it.

E19507 Unit – 01 Programming


44
4. Implemented code and pseudocode for the factorial algorithm
The code for the factorial capability intently follows the pseudocode.
It starts by instating multipliedNum to 1 and utilizes a for circle that emphasizes from 1
to n.
In every emphasis, it duplicates multipliedNum by the circle variable x, accordingly
really registering the factorial.
There are no significant deviations or additional optimizations required for this
implementation to be in direct alignment with the pseudocode.
Factorials can be calculated in a straightforward and effective manner with this
approach.
5. Efficiency of the algorithm (Evaluation)

Fibonacci calculation effectiveness


This calculation works out the nth Fibonacci number utilizing a circle that emphasizes n
times.
It has a time complexity of O(n) in Big O notation, which indicates that the time
required to compute the nth Fibonacci number grows linearly with n. As n builds, the
quantity of cycles in the know increments relatively, making it a productive calculation
with direct time intricacy for working out Fibonacci numbers.
Factorial capability calculation effectiveness
Using a loop that iterates n times, this algorithm calculates the factorial of a number n,
with an O(n) time complexity.
The Fibonacci algorithm, on the other hand, has a time complexity of O(n).
The two calculations scale straightly with the information size n, meaning their
runtime increments relatively as n develops.
Their performance continues to be usable in a wide range of applications where the
input size is not excessively large, as a result of their linear time complexity, which
makes them efficient for relatively small inputs.

E19507 Unit – 01 Programming


45
2nd Activity
Programming ideal models
Programming ideal models are urgent in understanding and dominating the universe
of software engineering.
These standards allude to different strategies and approaches used to take care of
perplexing issues while planning and carrying out programming.
Fostering serious areas of strength for an in programming ideal models can assist you
with turning out to be more capable in your picked field. Programming paradigms like
procedural, object-oriented, functional, and logic programming are the subject of this
article, which delves into their concepts, significance, and various types.
Moreover, it looks at the standards and instances of these ideal models, advantages
and disadvantages, as well as their genuine applications. At long last, it gives direction
on the best way to pick the right programming worldview for explicit activities and
adjust to various ideal models for greatest proficiency and adequacy.
(studysmarter, 2024)

Procedural programming
A programming language known as procedural uses a series of functions and
commands to carry out tasks. Many programming dialects utilize the procedural
programming worldview, including Fundamental, C and Pascal.
As many professional programmers begin their careers by learning to program in a
procedural programming language, learning to program in a procedural programming
language is frequently a foundational experience for aspiring developers.

Elements of procedural programming languages

1. Predefined capabilities
In a procedural programming language, a function from a library of available
functions is referred to as a predefined function. These capabilities permit a
software engineer to finish normal jobs without making the expected code
themselves. This can assist a designer with saving time during creation.
2. Local variables
A programming variable with a local scope of application is known as a local
variable. This implies the variable just capabilities in the capability wherein the
engineer characterizes it. If a professional or user attempts to use a local variable

E19507 Unit – 01 Programming


46
in a method that is outside of its scope, the code will fail and the task will not be
completed. Because local variables only function in this way, they can cause this.
3. Global variables
Worldwide factors increment usefulness when nearby factors are inadequate.
Nearly all functions allow developers to use global variables. A variable that is
defined globally makes itself accessible to all of the code's methods and functions,
allowing the programmer to access crucial data throughout the program's many
steps.

Procedural programming languages' advantages

•Flexibility:
Procedural writing computer programs is an adaptable worldview that permits
designers to make coding projects that achieve fundamentally changed objectives.
With procedural programming dialects intended for the vast majority various sorts of
advancement projects, including programming and web improvement, there's logical a
viable procedural programming language you can use to achieve your objectives

.
•Effortlessness:
Procedural writing computer programs is a generally basic way to deal with PC
programming. Because they provide a foundation for coding that the developer can
apply as they learn other languages, such as an object-oriented language, procedural
programming languages are the first choice of many developers.
•Openness:
Numerous well known programming dialects utilize procedural programming, so there
are numerous assets accessible to a hopeful engineer expecting to learn them. This
includes both paid courses and free online communities and resources that you can
use when you run into problems to help you grow faster. 2024 (Preston)

E19507 Unit – 01 Programming


47
Object Oriented Programming

Object-oriented programming (OOP) is defined as a programming paradigm (and not a


specific language) built on the concept of objects, i.e., a set of data contained in fields,
and code, indicating procedures – instead of the usual logic-based system.

OOP's Key Concepts

1. Class A
class is the essential unit of C++ that makes ready for object-situated programming.
It is a client characterized information type that can be gotten to and utilized by
making a case of that class.
It has its own member functions and data members. A class is tantamount to an
item's diagram. Both part works and information individuals are tracked down in
classes. The information individuals inside the class are controlled utilizing these part
works.
2. Object
The description is the first object to be defined when a class is created. An example
of a class exists in an item.
It is important to note that the system does not allocate any memory space when a
class is specified; rather, it does so when the class is instantiated, or when an object is
formed.
True things share state and conduct practically speaking, a couple of elements.
An object keeps its information in its attributes and uses methods to hide its
behavior.

E19507 Unit – 01 Programming


48
3. Syntax
The rules that determine how a language is organized are known as linguistic
structure.
In programming dialects (as opposed to normal dialects like English), sentence
structure is the arrangement of decides that characterize and direct how words,
accentuation, and images are coordinated in a programming language.
It is almost impossible to comprehend a language's semantics or meaning without
syntax.
A compiler or translator will not have the option to grasp the code in the event that
the sentence structure of a language isn't stuck to.
1. Encapsulation
Epitome is the method involved with gathering capabilities and information into a
solitary element. To get to these information individuals, the part capability's
extension should be set to "public," while the information individuals' degree should
be set to "private."
As indicated by this hypothesis, a thing contains extremely significant data; just a
little subset is made accessible to the rest of the world.
Each object's implementation and state are stored in a private class.
2. Inheritance
In its broadest sense, legacy alludes to the most common way of acquiring properties.
One article in OOP acquires the properties of another.
Engineers can reuse normal usefulness while holding an unmistakable progressive
system by doling out connections and subclasses between things.
This trait of OOP speeds up improvement and gives more exactness by requiring a
more top to bottom examination of the information.
The parent-youngster relationship is represented through legacy.

Benefits of OOP
•Empowers code reusability:
The possibility of legacy is one of the basic ideas presented by object-arranged
programming. Through inheritance, the attributes of a class can be handed down to
future generations without requiring additional work. Doing this forestalls the issues
related with over and again composing a similar code.

E19507 Unit – 01 Programming


49
•Increments efficiency in programming improvement:
We can make programs from pre-composed, interconnected modules as opposed to
beginning without any preparation, which would save time and increment efficiency.
Because of the OOP language, we can break the product into sensible, discrete issues.
Since it considers the division of work in the production of article based programs,
object-situated writing computer programs is particular.

• Ease of troubleshooting:
When object-oriented programming is used, troubleshooting is made easier because the
user
knows where to look in the code to find the problem's root cause. There is no need to
examine
any additional code areas because the error will indicate the location of the problem. One
advantage of encapsulation is that all objects in object-oriented programming (OOP) are self-
constrained. This multimodal behavior gives DevOps engineers and developers a lot of
advantages because they can now work on multiple projects simultaneously and avoid code
duplication. (BasuMallick, 2022)

Programing driven by events


In occasion driven programming, the program's stream is represented by occasions
like client connections or framework warnings.
Event handlers or callbacks are usually used to handle these events.
This worldview is normally utilized in graphical UI (GUI) applications and web
improvement, with JavaScript being an outstanding model.
Key qualities include:
1. Occasion Dealing with:
Answering explicit client activities or framework occasions, for example, button
snaps or console inputs.
2. GUI Development:
Enhancing the user experience by developing interactive graphical interfaces with
components like windows, buttons, and menus.

E19507 Unit – 01 Programming


50
3. Nonconcurrent Execution:
Permits numerous assignments to run freely, making it ideal for taking care of
simultaneous occasions.

4. Event Loop Management:


Controls the flow of events and makes sure they are processed in the right order.
Programming logic Sensible programming, exemplified by dialects like Prolog,
centers around characterizing intelligent standards and realities. Programs in this
worldview are based on proper rationale, making them ideal for undertakings like
man-made brainpower, master frameworks, and rule-based thinking.

Key attributes include:


1. Rule-based:
Sets of rules or conditions drive decisions and actions.
2. The core part
known as the inference engine uses pattern matching to match rule conditions to the
state of the system at the moment to process rules and draw conclusions.
3. Non-Successive Execution:
Dissimilar to procedural programming, execution isn't straight yet determined by
matching standards or examples.
4. Appropriateness for man-made intelligence:
Ideal for simulated intelligence applications including complex navigation and information
portrayal, especially where broad standards or information bases are involved.

Common Elements of Programming Standards

1. Deliberation:
Improves on complex cycles into reasonable parts, making code simpler to
work with and comprehend.

E19507 Unit – 01 Programming


51
2. Information Association:
Various ideal models sort out and control information in different ways, for
example, objects in object-situated programming or changeless designs in
useful programming.

1. Control Flow
is the process of determining the order in which instructions are carried out.
2. Simultaneousness:
Deals with various assignments or cycles running all the while.

The Benefits and Drawbacks of Programming Models


1. Procedural Programming -
Benefits:
- Effortlessness: Direct and straightforward.
- Effective for specific tasks: efficient
- Burdens:
- Intricacy: Can become perplexing for enormous undertakings.
- Restricted Reasonableness: Less powerful for complex true situations.

2. Object-Situated Programming (OOP)


- Benefits:
- Code Reusability: Works with reuse of code parts.
- Real-World Modeling: Effectively models relationships and objects from the real world.
- Hindrances:
- Execution Above:Potential execution costs because of deliberation layers.
- Complexity :Can become unpredictable with itemized plans.

E19507 Unit – 01 Programming


52
3. Occasion Driven Programming
- Benefits:
- Asynchronous Behavior: Allows for the simultaneous handling of multiple events.
- Secluded Code:Advances measured and responsive code.
- Negative aspects:
- Intricate Control Flow: Intricate control flow can result from managing numerous events.
- Potential Memory Leaks: Memory leaks can result from poorly managed events.

4. Sensible Programming
- Benefits:
- Inference Engine: A rule-based reasoning tool that makes use of an inference engine.
- Decisive Style: Utilizes a definitive methodology for critical thinking.
- Burdens:
- Rules' Complexity: It can be difficult to manage complex rule systems.
- Expectation to learn and adapt: Might be hard to learn because of its exceptional
methodology.

5. Information Driven Programming


- Benefits:
- Adaptability: Offers adaptability in information taking care of and client cooperations.
- User Customization: enables data processing customization.
- Drawbacks:
- Investigating Difficulties: Troubleshooting can be perplexing.
- Security Concerns:
If customized data is not handled properly, it may pose security risks. carefully. The selection
of a programming paradigm should be in line with the project's particular requirements and
constraints, as each paradigm has its own set of advantages and disadvantages.

E19507 Unit – 01 Programming


53
Relationships among Programming Models

1. Procedural Worldview
The procedural worldview lays the foundation for both item situated and occasion
driven programming. Programs are organized around procedures or functions in this
paradigm. Procedural aspects can be incorporated into both object-oriented and
event-driven paradigms, particularly when dealing with algorithm implementation
and regulating logical flow.

2. The Object-Oriented Approach


Expanding on procedural programming,
the item arranged worldview presents the idea of articles and classes,
which embody information and conduct. The modeling of real-world entities is made
simpler thanks to this strategy.
In spite of the fact that object-situated programming fundamentally centers around objects,
procedural components actually assume a part inside strategies that can use procedural code
for different undertakings.
3. An Event-Driven Approach
The occasion driven worldview is unmistakable from both procedural and
object-arranged ideal models, zeroing in on responding to occasions and client
collaborations. In spite of its unmistakable concentration, occasion driven
programming frequently consolidates object-situated standards, where
occasion overseers might be strategies for objects started up from classes.
3. logical framework
In contrast to procedural, object-oriented, and event-driven paradigms, the
logical paradigm places an emphasis on the formal rules and facts that express
program logic. While it tends to be utilized autonomously, it can likewise be
joined with different ideal models. For instance, consistent programming can
be coordinated into object-arranged frameworks to oversee complex dynamic
cycles.

E19507 Unit – 01 Programming


54
Activity 3

What is an IDE?
An integrated development environment (IDE) is a software package that includes the basic
tools required to design and test software.

Software developers use a range of tools for authoring, developing, and testing code.
Development tools include things like text editors, code libraries, compilers, and test platforms.
Without an IDE, a developer has to select, utilize, integrate, and oversee each of these tools on
their own. An Integrated Development Environment (IDE) might be a framework, application, or
service that combines many of these development-related elements. The integrated toolset is
designed to make software development easier and is capable of identifying and reducing typos
and code errors.

While some IDEs can be obtained for free, others require payment. An IDE can be a standalone
program or a part of a larger package (Gillis & Silverthorne, 2022).

E19507 Unit – 01 Programming


55
The primary elements of an IDE and the advantages of each element for
developing applications
An IDE frequently comes with a code editor, a compiler or interpreter, and a debugger.

Code editor: Designed specifically for editing computer system source code, the code editor is
one of the most essential tools for programmers. Simply put, a code editor is a text editor with
additional features for creating code. It simplifies coding for all users by providing more
advanced tools and enabling coding coloring. An IDE, independent software package, or web
browser can all come with a basic code editor. If a person is just starting out and learning to
code in any language, they should utilize a code editor. It performs similar tasks as a text editor
but has additional features and functionalities built in. These tools help make editing easier and
faster by identifying problems and troubleshooting code.

users in creating more advanced applications. There are numerous code editors available, such
as Atom, Visual Studio Code, Sublime Text, and many more.

The code editor is a useful tool for developers. As a result, provides a plethora of options for
theme customization.

able to manage big files with ease.

possesses some of the most powerful search capabilities in the sector.

has intelligent code completion that is compatible with the majority of languages.

Java, PHP, Perl, and JavaScript syntax highlighting.

Compiler: Computer software is created using high-level programming languages. These


programs and source codes are not understandable to computers, but they are to
programmers. Consequently, the source code is converted into machine-readable machine
code. A compiler is used for this conversion. A compiler thus serves as a translator, translating
source code from a high-level programming language to a lower-level machine language in
order to create an executable program. A compiler performs various duties in addition to
preprocessing, lexical analysis, parsing, semantic analysis, converting the input programs into an
intermediate representation, code optimization, and code production. Additionally, a compiler
converts all of the source code into machine code instantaneously. Programming languages like
C and C++ that have compiler support therefore execute more fast than other languages.

E19507 Unit – 01 Programming


56
Interpreter:
It is necessary to have an interpreter, compiler, and assembler. After the required inputs have
been supplied, all high-level languages must be converted into machine code in order for the
computer to comprehend the program. Software known as interpreters is used to translate high
level instructions line by line into machine level code in addition to compilers and assemblers.
The execution is stopped until the error is corrected if there is one on any line. Because it
delivers line-by-line errors, this approach of error repair is simpler, but it requires more time for
the program to function effectively. Interpreters were initially used in 1952 to make
programming easier within the limitations of the computers available at the time. It
immediately executes the conversion of source code into a suitable intermediate
representation.

Debugging:
Debugging is the process of identifying and resolving issues with software code that may cause
crashes or unexpected behavior. Sometimes, people refer to these mistakes as "bugs." Debugging
is the process of finding and repairing errors or defects in systems or software to prevent
improper operation. When many subsystems or modules are intimately related to one another,
debugging becomes more challenging since any changes made to one module may cause new
defects to arise in other modules. Sometimes developing software from scratch is quicker than
debugging it.

E19507 Unit – 01 Programming


57

You might also like