Technology is becoming increasingly advanced today, and has never been more prevalent in the world: it’s slowly being integrated into every aspects of our lives: from hospitals to classroom, in the car industry with robots to everyday life with smart assistants such as Microsoft’s Cortana or Amazon’s Alexa.
Softwares are an integral part to this trend of technology integration. As a part of the research and development team, my role is to use algorithms to build more efficient software. Many concepts and definitions, analysis, along with which Integrated Development Environment will be suitable for the development of this program will be discussed in the report bellow.
a. So, what’s an algorithm?
In mathematics and computer science, more specific, programming, an algorithm is a step by step method, which is used to solve a problem or to accomplish a task.
Algorithms can do many things, and so be used for various purposes, such as all kinds of calculation: the fastest route home, video compression, BMI index, to data processing and complex tasks such as automated reasoning.
An algorithm has 5 characteristics:
? Definite: Algorithms should be uncomplicated, clear in meaning and function. Each of its steps and phases, inputs and outputs should be easy to perceive, understand, or interpret, straightforward to only one meaning.
? Finite: Algorithms must have a finite number of steps. After that, the program should terminate.
? Input specified: An algorithm should have one or more distinct inputs.
? Output specified: An algorithm should have one or more distinct outputs.
? Precise and Effective: All operations performed should be the simplest as they can and perform their specified purposed.
Bellow are two an example of an algorithm.
Fig 2.a.1. An algorithm to compare two integers
Fig 2.a.2. An algorithm to make “Fiery red rice salad” (Berry, 2018)
Both Fig 2.a.1 and 2.a.2 are algorithms. Fig 2.a.1 is for a C# program, Fig 2.a.2 is used to make salad. Let’s examine to have a clearer idea of the characteristics of algorithm exhibited in them.
TABLE 2.A.1. FIGURES AND ALGORITHM CHARACTERISTCS:
Characteristic Fig 2.a.1 Fig 2.a.2
Definite Both algorithms are clear in meaning. Every steps serves a purpose and doesn’t have multiple meanings.
Finite Both algorithms have a certain amount of steps.
Ends after 5 steps Ends after 4 steps.
Input specified Prompts user to enter 2 integers, a and b. Ingredients needed to make the salad is listed.
Output specified Display the smaller number between the two. After following the recipe, you will have a dish of ready-to-serve salad.
Precise and Effective No extra steps that performs unnecessary things. All inputs and methods served a purpose, resulting in the desired output.
b. Criteria to measure a good algorithm:
A good algorithm is measured in time efficiency and space/size efficiency. It must perform task the fastest that it can and take as less resource as possible.
c. 7 steps of building an application:
Next, we will examine the 7 steps needed to build an application, which are:
? Defining of analysing the problem: Address what needs to be achieved, the purpose of the program.
? Design (Algorithm): Draw graphs or flowcharts to further illustrate the input, end goal and steps between that leads to it.
? Coding: Write the code needed for the program.
? Document the program: Add appropriate comments, guidelines, descriptions, name of the program or other identifiers, name of author, date/time of original release and updates, acknowledgement of any part of the program copied (legitimately) from other sources.
? Compiling and running the program
? Testing and Debugging: Test multiple inputs, situations, find errors and fix them.
? Maintenance: modify the software product after delivery to correct faults, to improve performance or other attributes
3. Programming paradigm
Programming paradigm classifies programming language based on their features. Programming languages can be classified into many paradigm, however, in this section, we will only focus on procedural, object-orientated and event-driven paradigms and their characteristics.
a. Procedural paradigm
? Focus on features (functions) and how these features can be linked together.
Characteristics of Procedural paradigm:
? Problem is divided into sub problems: a program is divided into several smaller programs called functions.
? Functions shares global data.
? No data security: data moves openly among functions, no encapsulation.
? Function transforms data from one form to another.
? Follows a top-down approach: contain a series of computational steps to be carried out, steps on top will be execute first, then the next one bellow it, until the last at the bottom.
b. Object-orientated paradigm
? Starts with objects and how they communicate.
? Focus on objects, manage activities around it.
Characteristics of Object-orientated paradigm:
? Abstraction: Hides irrelevant data to promote simplicity, along with increase efficiency.
? Encapsulation: Hide certain data. Acess using get and set.
? Inheritance: Inhert characteristics of another class, reuse code.
? Polymorphism: the ability of an object to take many form, the ability to refer to a child class object using the parent class object.
c. Event-driven paradigm:
? The flow of the program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or messages from other programs/threads.
? Performs certain actions in responds to user inputs.
? Usually used in Graphical User Interface (GUI), Web applications.