Professional Documents
Culture Documents
Learning outcome 1: Define basic algorithms to carry out an operation and outline the process of
programming an application....................................................................................................................2
P1: Algorithm and illustration:..............................................................................................................2
M1: Examine an algorithm's implementation and its link to code........................................................2
D1: Programming applications:.............................................................................................................3
Learning outcome 2: Characteristics of procedural, object-orientated and event-driven
programming.............................................................................................................................................4
P2: Explanation, Features, and Relationships:.....................................................................................4
M2: Compare, Contrast used with a source code of an application:.....................................................4
D2: Evaluation, code structure and characteristics.............................................................................10
Learning outcome 3: Using an IDE, write fundamental algorithms in code.......................................12
P3: Write a program that implements an algorithm using an IDE:........................................................12
M3: Use of an IDE for development of applications:..............................................................................16
D3: Use the IDE to control the program's development process:............................................................16
Learning outcome 4: Importance of a coding standard and debugging process................................17
P4: Debugging procedure and IDE debugging facilities:....................................................................17
M4: Evaluate, help develop more secure debugging, robust applications:.........................................18
D4: Evaluate why a coding standard is necessary:..............................................................................18
P5: Outline the coding standard you have used in your code:............................................................19
1
Learning outcome 1: Define basic algorithms to carry out an operation and
outline the process of programming an application.
P1: Algorithm and illustration:
An algorithm is a step-by-step method that provides a set of instructions that must
be followed in a certain order to get the desired result.
Because algorithms are often created independently of the underlying languages,
they may be implemented in more than one computer language.
An algorithm's attributes include clarity, excellence, effectiveness, and language
independence. The importance of an algorithm is determined by its performance
and scalability.
An algorithm is a set of instructions that a computer must follow in order to
perform calculations or other problem-solving activities.
An algorithm is defined as a way for solving a problem step by step.
Characteristics:
Input: The algorithm needs certain values as input. The algorithm may accept non-zero
input.
Output: There are one or more outcomes at the conclusion of the process.
Finiteness is required for the algorithm. In this case, finiteness denotes that the method
uses a finite amount of instructions. H. The instructions must be able to be counted.
Validity: Because each instruction in the algorithm has an impact on the whole process,
it must be suitable.
2
admin (n.d.). [online] Available at: https://www.google.com/search?
q=6+Steps+To+Write+Any+Machine+Learning+Algorithm+From+Scratch
%3A+Perceptron+Case+Study+%7C+by+John+Sullivan+
%7C+Towards+Data+Science&rlz=1C1CHWL_enPK892PK892&oq=6+Steps+To+Write
+Any+Machine+Learning+Algorithm+From+Scratch%3A+Perceptron+Case+Study+
%7C+by+John+Sullivan+
%7C+Towards+Data+Science&aqs=chrome.0.69i59.416j0j9&sourceid=chrome&ie=U
TF-8 [Accessed 20 Jul. 2022].
D1: Programming applications:
Think of it as a rough guide to what to do when you step into the world of programming.
Create a Solution
Once you've determined what you need to solve the issue and what the solution should
look like, the following step is to figure out how to turn that specification into a working
programmer. Usually, this is the most challenging duty. As previously said, a
programmer is merely a series of instructions that instruct your computer on what to
accomplish. The design is just a high-level breakdown of these processes. It is, in reality,
a programmer built as if the computer were a person. As a result, it is not essential to
completely describe each step. People already know how to perform a lot of things and
have a lot of common sense. This implies you can do basic tasks on your own. You are
not even required to write in a computer language. It might be in English (although more
complex sections often use special notations such as pseudo code and flowcharts).
Write a Program
The aim of programming is to describe the design to your computer. That is, instructing
students on how to solve the design.
A programmer is typically written in three stages:
Coding
Compiling
Debugging
3
Learning outcome 2: Characteristics of procedural, object-orientated and
event-driven programming.
P2: Explanation, Features, and Relationships:
Relationship
Procedural OOP Event based
A programmer and its Object oriented programming Event-based programming
subprograms are defined as a is a method of arranging code entails developing event
set of stages in procedural based on encapsulation, handling routines and relying
programming. Declarative inheritance, replacement, on the underlying system's
programmers, on the other programming to interfaces, fundamental event loop. You
hand, attempt to explain the and other ideas. Object- may avoid the difficulty of
outcome without respect for oriented programming are building your own event loop
the processes necessary to often procedural in nature. by taking use of several
computerize it, but rather libraries that already operate
some description or with the system-provided
denotation of the intended event loop. Event-based
result. applications are often written
in an object-oriented
paradigm, however this is not
always the case.
Admin (n.d.). [online] Available at: https://www.quora.com/What-are-the-
relationships-between-programming-procedural-object-oriented-and-event-driven-
paradigms [Accessed 20 Jul. 2022].
// function declaration
int main ()
int a = 10;
int b = 20;
int res;
4
res = sum(a, b);
std::cout << a << "+" << b << "=" << res << std::endl;
return 0;
int result;
return result;
OOP
// C++ program to implement the ATM
// Management System
#include <iostream>
#include <stdlib.h>
#include <string.h>
using namespace std;
class Bank {
// Public variables
5
public:
// Function to set the person's data
void setvalue()
{
cout << "Enter name\n";
cin.ignore();
6
{
cout << "\nEnter amount to be Deposited\n";
cin >> amount;
}
// Function to show the balance amount
void showbal()
{
tot = tot + amount;
cout << "\nTotal balance is: " << tot;
}
// Function to withdraw the amount in ATM
void withdrawl()
{
int a, avai_balance;
cout << "Enter amount to withdraw\n";
cin >> a;
avai_balance = tot - a;
cout << "Available Balance is" << avai_balance;
}
};
// Driver Code
int main()
{
// Object of class
Bank b;
int choice;
7
// Infinite while loop to choose
// options everytime
while (1) {
cout << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~"
<< "~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
<< "~~~WELCOME~~~~~~~~~~~~~~~~~~"
<< "~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
<< "~~~~~~~~~\n\n";
cout << "Enter Your Choice\n";
cout << "\t1. Enter name, Account "
<< "number, Account type\n";
cout << "\t2. Balance Enquiry\n";
cout << "\t3. Deposit Money\n";
cout << "\t4. Show Total balance\n";
cout << "\t5. Withdraw Money\n";
cout << "\t6. Cancel\n";
cin >> choice;
8
case 3:
b.deposit();
break;
case 4:
b.showbal();
break;
case 5:
b.withdrawl();
break;
case 6:
exit(1);
break;
default:
cout << "\nInvalid choice\n";
}
}
}
9
call event-handler for event_nn with event parameters else handle unrecognized event // ignore or raise
exception
end loop
fact = fact * i;
cout « "Factorial of " << num « " is: " << fact << endl;
10
return 0;
class GFG {
System.out.println("GfG!");
class Signup { int userid; String name; String emailid; char sex; long mob;
public void create(int userid, String name, String emailid, char sex, long mob){
this.emailid = "radha.89@gmail.com";
this.sex = 'F';
this.mob = 900558981;
Event-driven paradigms
o Service oriented
o Time driven
import asyncio
1p = asyncio.get_event_loop()
1p.call_soon(hello_world, 1p)
1p.run_forever() 1p.close()
11
Learning outcome 3: Using an IDE, write fundamental algorithms in code.
#include<iostream>
#include<vector>
#include<stdio.h>
#include<cstring>
#include<fstream>
#include<algorithm>
class course {
char name[80],branch[50];
void input() {
cin>>reg; fflush(stdin);
gets(branch);
} void display()
system("CLS");
void display()
{ system("CLS");
cout<<"\t\tDisplay Records";
12
cout<<"\n Course - "<<branch;
cout«"\n";
system("PAUSE");
system("CLS");
}; vector <course>v;
void get_file()
course x;
2 -s 2 n .
fstream f;
f.open("College.txt",ios::out);
for(int i=0;i<v.size();i++) {
(.close();
for(i=0;i<v.size();
} return ta;
1++) if(strcmp(v[i].name,name)==0)
13
Figure 1
Figure 2
Figure 3
14
Figure 4
Figure 5
Figure 6
15
Figure 7
16
Visual Studio.
Eclipse.
NetBeans.
Common features of an IDE
IDEs have been around for decades.
From being merely a platform for debugging and testing purposes to an integrated piece
of software that can be an extension of the developer, IDE's continue to evolve and
change with time.
Here are some standard features of an IDE:
Text editor:
Debugger:
Compiler:
Code completion:
Admin (n.d.). [online] Available at: https://www.sitepoint.com/what-is-an-ide/
[Accessed 20 Feb. 2022].
Compile-time: Run-time:
These are caused by the incorrect usage of
language constructs, such as syntax These are substantially more difficult to
mistakes. Normally, utilizing compiler decipher since they cause the programmer
tools and warnings to address stated errors to produce inaccurate output (or "crash")
makes it pretty straightforward to during execution.
discover. This lecture will look at how to
troubleshoot a run-time mistake in C code
carefully.
Debugging facilities
Typical debugging features include the ability to run or halt the target programme at
specific points, display the contents of memory, CPU registers, or storage devices (such
as disc drives), and modify memory or register contents to enter selected test data that
could be the cause of faulty programme execution.
17
Debugging is the process of going through the software step by step to find and fix any
faults or bugs.
The IDE generally includes a debugger software.
If a part of code produces different results than expected, attempt to make that section of
code operate in isolation. Admin (n.d.). [online] Available at:
http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=
%2Fcom.qnx.doc.ide.userguide%2Ftopic%2Fdebug_Base_.html [Accessed 20
Jul. 2022].
Figure 8
18
Figure 9
19
Moving to the advantages of OOP, we would like to say that there are many as this is one of the
core development approaches which is widely accepted. Let’s see what the advantages of OOP
are offers to its users.
Data Redundancy
Polymorphism Flexibility
Re-usability
Code Maintenance
Security
Easy troubleshooting
20