Prog
Prog
Prog
ALGORITHM
An algorithm is a process used to carry out a computation or solve a problem. In either
hardware-based or software-based routines, algorithms function as a detailed sequence of
instructions that carry out predetermined operations sequentially
All aspects of information technology employ algorithms extensively. A simple technique that
resolves a recurring issue is typically referred to as an algorithm in mathematics and computer
science. Algorithms are essential to automated systems because they serve as specifications
for processing data.
An algorithm may be employed for simple tasks like sorting lists of numbers or for more
challenging ones like suggesting user content on social media. The starting input and
instructions for an algorithm's calculation are often provided. When the calculation is finished,
an output is created.
HOW to it worked?
Natural languages, programming languages, pseudocode, flowcharts, and control tables can all
be used to express algorithms. Expressions in natural languages are uncommon because they
are more ambiguous. A computer's algorithms are often expressed in programming languages.
An initial input and a list of instructions are used by algorithms. The input, which may be
expressed as either words or numbers, is the first batch of information required to make
judgments. The input data is subjected to a series of instructions, or calculations, which may
involve mathematical operations and judgment calls. The final step of an algorithm is called the
output, and it is typically stated as more data.
A search algorithm could, for instance, take a search query as input and process it via a series
of directives for searching a database for things that match the query. As automation adheres to
a set of rules to execute tasks, automation software serves as another illustration of an
algorithm. Automation software is made up of several algorithms, all of which function to
automate a certain activity.
This algorithm accepts keyword and operator search strings as input, browses its
related database for pertinent URLs, and then outputs results.
A cryptographic algorithm.
P a g e 1 | 21
This computing algorithm alters data to safeguard it in accordance with predetermined
actions. The Data Encryption Standard, for instance, employs a symmetric key
technique that encrypts and decrypts data using the same key. No one without the key
can decode the data as long as the algorithm is complex enough.
avaricious algorithm
By locating the locally optimum solution, this technique attempts to locate the globally
optimal solution to optimization issues. It does not, however, ensure the best outcome.
algorithm with recursion.
This algorithm keeps calling itself until an issue is resolved. When a recursive function is
called, recursive algorithms call themselves with a reduced value each time.
algorithm for going back.
This typical algorithm is split into two sections. A issue is split into smaller subproblems
in one segment. The second section fixes these issues before putting them all together
to create a solution.
algorithm for dynamic programming
By breaking down difficulties into smaller ones, this program finds solutions. The
outcomes are then saved for use in solving related challenges in the future.
aggressive algorithm.
This algorithm searches blindly for one or more solutions to a problem by iterating all
potential solutions.
algorithm for sorting.
Sorting algorithms are used to change the order of data in a data structure depending
on a comparison operator.
Hashing formula.
Running times and time-based complexity are reduced by this approach. Its reasoning
is based in part on random components.
P a g e 2 | 21
What types of algorithms are there?
A excellent example of an algorithm is machine learning, which predicts outcomes without
having been expressly taught to do so. Unsupervised learning or supervised learning are both
used in machine learning. In supervised learning, data scientists set the variables they want the
algorithm to look for connections between and feed the sophisticated algorithms with labeled
training data. The algorithm's input and output are both listed.
Algorithms that use unlabeled data to train are known as unsupervised machine learning.
Unsupervised machine learning techniques search through unlabeled data for patterns that may
be utilized to divide data points into subsets. Unsupervised algorithms make up the majority of
deep learning techniques, including neural networks.
Algorithms are also utilized in artificial intelligence's machine learning techniques. But the data
that machine learning-based systems use to train their algorithms may have inherent biases.
Systems that are potentially destructive and unreliable might develop from this.
There are some types of algorithms
1. Sort algorithms
2. Search algorithms
3. Hashing
4. Dynamic Programming
5. Exponential by squaring
6. String matching and parsing
7. Primality testing algorithms
Factors of algorithm
1.Modularity:
If you are given a problem and break it down into small-small modules or small-small
stages, which is a basic description of an algorithm, this characteristic was properly built
for the algorithm.
2.Correctness:
An algorithm is said to be accurate when the provided inputs result in the expected
output, which shows that the method was properly developed. The analysis of an
algorithm has been correctly finished.
3.Maintainability:
This refers to the idea that the algorithm should be created in a simple, organized
manner so that when it is redefined, it does not undergo substantial changes.
P a g e 3 | 21
4.Functionality:
The designer won't describe the method to the coder if it is difficult to comprehend.
7.Simplicity:
P a g e 4 | 21
The process involved in build an application
1. Planning and research
2. Proto typing
3. Design
4. Development
5. Testing
6. Release
7. Maintained
Researching the market and doing a feasibility study are typically included in planning. It
is necessary to provide answers to questions like "Are there other applications that do
what mine will accomplish," "Is there a need for my app?" and "What is the value
proposition of my app." Before investing a significant amount of money in developing
and promoting your app, it is crucial to know whether there is a market niche for your
app concept.
Choosing the platforms your app will run on is another important decision (iOS, Android,
Web, etc.). You must choose between a hybrid strategy and developing natively for
each platform if you plan to create for more than one. Consider the level of competition
and the location of your target market when choosing the platform(s) that make sense
for your app. These next two inquiries can assist you in determining not only whether
the app as a whole is feasible but also where you would want to focus early
development efforts in order to create a proof-of-concept.
To ensure that your app at least has a possibility of success, it is crucial to spend a lot
of effort in advance on preparation. Pose the inquiries. 1) Are there users of your app? ;
and 2) Are there users willing to pay for your app? You should be able to respond "yes"
to these questions with confidence before moving on to the design process.
Given that you haven't put much money into this place yet, don't be frightened to stay a
while. It is better to have faith in the viability of your app's market than to release it and
discover that you should have catered it to a different audience or avoided building it at
all.
P a g e 5 | 21
2.Proto typing
During the prototyping phase, you begin quickly creating wireframes and making
adjustments based on user input. A wireframe, which provides an overall idea of the
operation and flow of your app without delving into the finer points of color or design,
may be viewed of as a low-fidelity reference to the UI and UX of your app. Focus on
displaying the main features of your app's MVP (minimum viable product) in your
wireframes rather than giving them a comprehensive feature set in order to get input.
You may use resources like IN Vision to gather input on the wireframes for your app. It is
imperative that you collect input from a sizable portion of your target audience. Without
it, you risk creating an app that falls short in terms of usefulness for your target market.
For instance, you may create a ticket booking software that takes two hands to use
comfortably, only to learn after it is out that your target market of business people won't
bother to use it since they only have one hand free as they rush through the airport with
their baggage.
It is crucial to adopt an iterative process at this point so you may show as many mock-
ups to your consumers as you can, allowing your app's functionality plan to change and
adapt. Don't be reluctant to take your time here since you want to be certain that your
app will in fact satisfy the demands of your audience. Instead of having to go back to this
stage in the middle of development, it is preferable to get off on the right foot from the
beginning.
It is time to move on to the design phase after revising the feedback you have obtained
from your audience and making sure that they are favorably responding to your
prototype.
3.Design
We will only quickly touch on some of the most significant elements in the design phase
of the creation of an app. First, it is up to your UX and UI designers to improve the
wireframes that have already been authorized. This entails UI element placement and
design, user flow definition, a comprehension of element hierarchy, etc. You should now
create high-fidelity mockups that your developers may use to create a functioning app.
These mockups should also include information on what happens when objects are
tapped, swiped, dragged, etc.
If you don't already have one, you should create a brand guideline to ensure that your
app's identity is recognizable and well-understood by both your designers and
developers. Each screen must adhere to your rules in order for your app to be
cohesively designed.
At this point, a marketing plan should also be developed. Typically, this entails planning
how you will promote your app (social media, creating a blog, etc). A website to gather
emails from individuals who could be interested in your product, a newsletter, or a social
media following might also be necessary.
P a g e 6 | 21
4.Development
You really start writing the code for the "final" version of the program during the
development phase. Here, you utilize the input from the wireframes to inform some
significant, maybe final decisions.
Here is where techniques like agile or waterfall may be used. A mobile application
should ideally be developed using an agile methodology. In a subsequent post, these
techniques for creating software products will be covered in more detail.
Also, integrating an analytics engine into your app during this phase is critical.
Create events for all possible user interactions so you can see how your app is
being used and the general flow of users. This information will become very
useful to learn about your users and further iterate on your app's design once it
is released to the world so you can make the best product possible.
5.Testing
In an ideal world, testing happens concurrently with the development phase. To keep
post-release expenses down, testing must be ongoing. To make sure that any serious
flaws or oversights are fixed as soon as possible, unit tests, UI tests, and integration
testing are required. Test cases might lengthen the development process, but over the
long haul, they can significantly cut down on the time and expense associated with
maintenance and support.
Testing will also be beneficial later on when your software is being maintained. Without
needing a person to manually go through each test case, you may run all of your test
cases after making a tiny change to see where your modifications might have damaged
other areas of the system.
6.Release
This is where you will request clearance for your software on the App Store or Play
Store. Understanding this procedure is crucial because you will use it each time you
release a new version of the app. At this stage of the development procedure, you ought
to have fixed the majority of the significant flaws that your testers discovered, and your
program ought to be of a caliber that will meet the requirements of the store where you
intend to submit it.
Congratulations! The whole public can use your app. However, your effort is not yet
done. You effectively go back to prototyping once you release your app. You will be
looking through customer input, perhaps adding new features, and then re-releasing.
With these 5 steps
P a g e 7 | 21
7.Maintance
This phase should develop concurrently with release and really starts at the same time.
When performing maintenance, you check your app's performance, address any
problems that may be there, and ensure that it keeps functioning as intended.
Maintenance also includes updating your app to accommodate new devices or new OS
versions.
Your app requires ongoing maintenance at all times. You will continue to support your
app eternally until and until you decide to stop (possibly leaving your users.
START
RETURN 1
DEF LOGIN( ):
IF CHECK(USERNAME ,PASSWORD) == 1 :
RETURN 1
END
P a g e 8 | 21
TASK101.PY
START
DEF INCOME(INC):
FILE.WRITE( INC )
FILE.CLOSE( )
FILE.WRITE( EXP )
FILE.CLOSE( )
CHECK = LOGIN( )
IF CHECK == 1:
WHILE TRUE:
IF INC == “STPINC”:
BREAK
INCOME (INC)
WHILE TRUE:
P a g e 9 | 21
EXP = INPUT(“ENTER EXPENSE :”)
IF EXP == “STPEXP”:
BREAK
EXPENSE (EXP)
END
SUMMERY.PY
START
CHECK = LOGIN( )
IF CHECK == 1:
TOTAL = 0
RECORD = 0
RECORD = RECORD + 1
INCOME = TOTAL
PRINT(“AVERAGE IS:”,AVERAGE)
TOTAL = 0
RECORD = 0
P a g e 10 | 21
FOR FILE IN FILES:
RECORD = RECORD + 1
EXPENSE = TOTAL
PRINT(“AVERAGE IS:”,AVERAGE)
END
P a g e 11 | 21
Task 02
Define characteristics of procedural, object-orientated and event-
driven programming
Programming paradigm
Programming paradigms are many organizational structures that can be used with a particular
program or programming language. Each paradigm has a unique set of structures, attributes,
and ideas about how to approach typical programming issues.
The reason why there are several programming paradigms is comparable to the reason there
are numerous programming languages. It makes sense to employ several paradigms for various
projects since different paradigms are better suited for various sorts of challenges.
Additionally, each paradigm's practices have changed over time. Thanks to improvements in
technology and software, new strategies that weren't previously possible have emerged.
I believe that human creativity comes last. As a species, we just like inventing new things,
enhancing previous creations, and modifying instruments to suit our tastes or what appears to
be more effective to us.
All of this leads to the fact that we now have a wide range of possibilities when it comes to
writing and structuring a particular program.
P a g e 12 | 21
Procedural Programming
Procedural programming is a programming paradigm that focuses on defining procedures or routines
that perform operations on data. It is based on the concept of structured programming, which
emphasizes the use of structured control flow constructs like sequences, loops, and conditionals.
In procedural programming, programs are divided into procedures or functions, which are essentially
named blocks of code that can be called and executed when needed. These procedures can take inputs,
process them, and produce outputs. The main program typically calls these procedures in a specific
order to accomplish tasks.
1. **Procedures or Functions**: These are the building blocks of procedural programs. They encapsulate
a set of instructions to perform a specific task. Procedures can take parameters as input and may return
values as output.
2. **Sequential Execution**: Procedural programs are executed sequentially, meaning that instructions
are executed one after another in the order they are written, unless control flow statements like loops
or conditionals are used to alter the flow.
4. **Variable Scope**: Variables in procedural programming typically have limited scope, meaning they
are only accessible within the procedure or block in which they are declared.
6. **Limited Data Hiding**: Procedural programming does not inherently support data hiding or
encapsulation as in object-oriented programming. However, some level of data hiding can still be
achieved through careful design.
P a g e 13 | 21
Popular programming languages that support procedural programming include C, Pascal, and BASIC.
While procedural programming is a powerful paradigm, it may not be as suitable for managing
complexity in large-scale applications compared to object-oriented or functional programming
paradigms. Nonetheless, it remains a fundamental concept in computer science and software
development.
1. **Encapsulation**: Encapsulation refers to the bundling of data (attributes) and methods (functions
or procedures) that operate on the data into a single unit or class. This helps in hiding the internal state
of an object and only exposing necessary functionalities to the outside world, thus promoting data
abstraction and information hiding.
2. **Inheritance**: Inheritance allows a class (subclass or child class) to inherit attributes and methods
from another class (superclass or parent class). This promotes code reuse and enables hierarchical
relationships between classes, where subclasses can extend or specialize the behavior of their parent
classes.
3. **Polymorphism**: Polymorphism means the ability of different objects to respond to the same
message or method call in different ways. This can be achieved through method overriding (redefining a
method in a subclass) or method overloading (having multiple methods with the same name but
different parameters).
4. **Abstraction**: Abstraction involves simplifying complex systems by modeling classes based on real-
world entities and focusing on essential properties and behaviors while ignoring irrelevant details. It
allows developers to create a simplified representation of real-world objects in software.
5. **Classes and Objects**: Classes serve as blueprints or templates for creating objects. They define
the structure and behavior of objects, including their attributes and methods. Objects are instances of
classes, representing specific instances or occurrences of the class in memory.
6. **Message Passing**: In OOP, objects communicate with each other by sending and receiving
messages. A message typically consists of a method invocation on an object, triggering the execution of
the corresponding method associated with the object.
Object-oriented programming languages include Java, C++, Python, and Ruby, among others. OOP
promotes modular, maintainable, and scalable software development by facilitating code reuse,
abstraction, and encapsulation. It is widely used in various domains, including software engineering,
game development, and web development.
P a g e 14 | 21
Event Driven programming
It is an approach in which code is written to respond to events. Events can be triggered by users, such as
clicking on an icon or entering something. And also sensors used to detect events such as when a
particular temperature of a room and or specific water level is detected on a flood defense system.
Provides character user Provides command writing in Provides GUI to create the
interface to write the modules programs.
commands
Commands are written in linear Objects and methods are Actions are defined on an event,
way and executed also in linear prepared for interaction to The event could be occurred by
way perform specific task mouse clicking and moving or
keyboard strokes.
Focuses on sequential execution Focuses on object or data and Focuses on selecting user
steps facilitate to secure it from interface
unauthorized access
A job to save the data is carried out in the background when a user enters data into the system
and hits enter. That's the operation of event-driven programming.
P a g e 15 | 21
Debugging and importance of a coding standard
# Debugging:
Debugging is the process of identifying and fixing errors, bugs, or defects in software code. It's an
essential part of the software development lifecycle and involves systematically finding and resolving
issues to ensure that the program behaves as expected. Here are some key aspects of debugging:
1. **Identification of Issues**: Debugging starts with identifying problems in the code. This could be
done through various means, such as observing unexpected behavior, analyzing error messages, or using
debugging tools to trace the program's execution.
2. **Isolation of Bugs**: Once an issue is identified, the next step is to isolate the bug's root cause. This
involves examining the code, reviewing data structures and algorithms, and sometimes using debugging
techniques like breakpoints or print statements to understand the program's behavior.
3. **Fixing Bugs**: After isolating the bug, developers need to apply the necessary fixes to resolve the
issue. This may involve modifying the code, updating algorithms, or reconfiguring settings to correct the
problem.
4. **Testing**: Once the bug is fixed, thorough testing is crucial to ensure that the issue has been
resolved and that no new bugs have been introduced. Testing can involve unit tests, integration tests,
system tests, and user acceptance testing to verify the program's functionality and stability.
5. **Documentation**: It's important to document the debugging process, including the steps taken to
identify and fix the bug, as well as any lessons learned or best practices discovered during the process.
This documentation can be valuable for future reference and for sharing knowledge within the
development team.
A coding standard is a set of guidelines, conventions, and best practices that developers follow when
writing code. Here's why coding standards are important:
1. **Consistency**: Coding standards promote consistency in code style, formatting, and structure
across the development team. Consistent code is easier to read, understand, and maintain, leading to
improved collaboration and productivity.
P a g e 16 | 21
easier to debug, refactor, and extend, reducing the likelihood of errors and making the codebase more
maintainable.
3. **Reduced Bugs**: Following coding standards can help reduce the occurrence of common coding
errors and bugs. For example, consistent naming conventions can prevent confusion and typos, while
standardized error handling practices can improve code robustness and reliability.
4. **Enforced Best Practices**: Coding standards often incorporate best practices and design principles
that help developers write better-quality code. By enforcing these best practices, coding standards can
improve code quality, performance, and security, while also facilitating code reviews and audits.
5. **Ease of Onboarding**: Coding standards provide a set of guidelines that new developers can follow
to quickly understand and contribute to the codebase. This accelerates the onboarding process and
ensures that new code aligns with existing code quality standards.
In summary, debugging and coding standards are both essential aspects of software development that
contribute to the overall quality, reliability, and maintainability of software products. By following
systematic debugging techniques and adhering to coding standards, developers can produce high-
quality code that meets user requirements and industry best practices.
Documentation of a budget calculating system is crucial for ensuring that users, developers, and
stakeholders understand how the system functions, how to interact with it, and how it's designed.
Here's an outline of the types of documentation typically required for a budget calculating system:
1. **System Overview**:
- Brief description of the purpose and objectives of the budget calculating system.
- Explanation of why the system is needed and its intended users.
- Overview of the main features and functionalities provided by the system.
2. **Architecture Documentation**:
- High-level architecture diagram illustrating the components and interactions of the budget
calculating system.
- Description of each component, including its purpose, responsibilities, and dependencies.
- Explanation of how data flows through the system and any integration points with external systems.
3. **Design Documentation**:
- Data model describing the structure of the budget data, including entities, attributes, and
relationships.
- Class diagrams or entity-relationship diagrams (ERDs) showing the design of the system's data model.
- Description of algorithms or formulas used for calculating budgets and performing financial analysis.
P a g e 17 | 21
4. **Functionality Documentation**:
- Detailed description of the functionalities provided by the budget calculating system, such as:
- Creating and managing budget templates.
- Entering and updating budget data.
- Generating reports and analysis based on budget data.
- Setting up budget approval workflows.
- Use cases or user stories illustrating how different user roles interact with the system to perform
common tasks.
5. **User Guides**:
- Step-by-step instructions for users on how to perform various tasks within the system, including:
- Logging in and accessing the system.
- Creating, editing, and deleting budget entries.
- Running predefined reports and customizing report parameters.
- Exporting budget data to other formats (e.g., Excel, PDF).
- Screenshots or illustrations to accompany the instructions and provide visual guidance.
8. **Security Documentation**:
- Overview of the security features and measures implemented in the system to protect sensitive
budget data.
- Access control policies and roles defining who can access, view, and modify budget information.
- Data encryption, authentication, and authorization mechanisms used to secure user interactions with
the system.
By providing comprehensive documentation for the budget calculating system, organizations can ensure
that users are equipped with the necessary information to effectively utilize the system, developers can
understand its design and implementation, and stakeholders can make informed decisions about its
usage and maintenance.
Documentation of a budget calculating system is crucial for ensuring that users, developers, and
stakeholders understand how the system functions, how to interact with it, and how it's designed.
Here's an outline of the types of documentation typically required for a budget calculating system:
1. **System Overview**:
- Brief description of the purpose and objectives of the budget calculating system.
- Explanation of why the system is needed and its intended users.
- Overview of the main features and functionalities provided by the system.
2. **Architecture Documentation**:
- High-level architecture diagram illustrating the components and interactions of the budget
calculating system.
- Description of each component, including its purpose, responsibilities, and dependencies.
- Explanation of how data flows through the system and any integration points with external systems.
3. **Design Documentation**:
- Data model describing the structure of the budget data, including entities, attributes, and
relationships.
- Class diagrams or entity-relationship diagrams (ERDs) showing the design of the system's data model.
- Description of algorithms or formulas used for calculating budgets and performing financial analysis.
4. **Functionality Documentation**:
- Detailed description of the functionalities provided by the budget calculating system, such as:
- Creating and managing budget templates.
P a g e 19 | 21
- Entering and updating budget data.
- Generating reports and analysis based on budget data.
- Setting up budget approval workflows.
- Use cases or user stories illustrating how different user roles interact with the system to perform
common tasks.
5. **User Guides**:
- Step-by-step instructions for users on how to perform various tasks within the system, including:
- Logging in and accessing the system.
- Creating, editing, and deleting budget entries.
- Running predefined reports and customizing report parameters.
- Exporting budget data to other formats (e.g., Excel, PDF).
- Screenshots or illustrations to accompany the instructions and provide visual guidance.
8. **Security Documentation**:
- Overview of the security features and measures implemented in the system to protect sensitive
budget data.
- Access control policies and roles defining who can access, view, and modify budget information.
- Data encryption, authentication, and authorization mechanisms used to secure user interactions with
the system.
P a g e 20 | 21
10. **Training Materials** (Optional):
- Training manuals, presentations, or videos to help users and administrators learn how to use and
manage the budget calculating system effectively.
- Training schedules and resources for conducting hands-on training sessions or workshops.
By providing comprehensive documentation for the budget calculating system, organizations can ensure
that users are equipped with the necessary information to effectively utilize the system, developers can
understand its design and implementation, and stakeholders can make informed decisions about its
usage and maintenance.
P a g e 21 | 21