You are on page 1of 20

Table of Contents

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.

Admin (n.d.). [online] Available at: https://www.simplilearn.com/tutorials/data-


structure-tutorial/what-is-an-algorithm [Accessed 20 Jul. 2022].

M1: Examine an algorithm's implementation and its link to code.

Learn the basics of the algorithm.


Look for various learning resources.
Divide the algorithm into sections.
Begin with a basic example.
Validate with a reliable implementation.
Document your procedure.

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.

Identify the Problem


In fact, this stage should really be called identifying the solution because what you're really
trying to do is to tie down exactly what it is that you're trying achieve.

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

Admin (n.d.). [online] Available at:


https://www.cs.bham.ac.uk/~rxb/java/intro/2programming.html [Accessed 20 Jul.
2022].

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

M2: Compare, Contrast used with a source code of an application:


 Procedural paradigms
#include <iostream>

// function declaration

int sum(int numl, int num2);

int main ()

// local variable declaration:

int a = 10;

int b = 20;

int res;

// call to sum function

4
res = sum(a, b);

std::cout << a << "+" << b << "=" << res << std::endl;

return 0;

// function returning the sum of two numbers

int sum(int numl, int num2) {

int result;

result = numl + num2;

return result;

 OOP
// C++ program to implement the ATM
// Management System
#include <iostream>
#include <stdlib.h>
#include <string.h>
using namespace std;
class Bank {

// Private variables used inside class


private:
string name;
int accnumber;
char type[10];
int amount = 0;
int tot = 0;

// Public variables

5
public:
// Function to set the person's data
void setvalue()
{
cout << "Enter name\n";
cin.ignore();

// To use space in string


getline(cin, name);

cout << "Enter Account number\n";


cin >> accnumber;
cout << "Enter Account type\n";
cin >> type;
cout << "Enter Balance\n";
cin >> tot;
}
// Function to display the required data
void showdata()
{
cout << "Name:" << name << endl;
cout << "Account No:" << accnumber << endl;
cout << "Account type:" << type << endl;
cout << "Balance:" << tot << endl;
}
// Function to deposit the amount in ATM
void deposit()

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;

// Choices to select from


switch (choice) {
case 1:
b.setvalue();
break;
case 2:
b.showdata();
break;

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";
}
}
}

 Event Driven paradigms


do forever: // the main scheduler loop

get event from input stream

if event type == EndProgram:

quit // break out of event loop

else if event type .= event_01:

call event-handler for event_01 with event parameters

else if event type .= event_02:

call event-handler for event_02 with event parameters

else if event type .= event_nn:

9
call event-handler for event_nn with event parameters else handle unrecognized event // ignore or raise
exception

end loop

Admin (n.d.). [online] Available at: https://www.assignmentexpert.com/homework-


answers/programming-and-computer-science/c-sharp/question-246635 [Accessed
20 Jul. 2022].
D2: Evaluation, code structure and characteristics.

 A paradigm is also a way for solving a problem or performing a job.


 A programming paradigm is a strategy to solving a problem using a programming
language, or it may be defined as a way of solving a problem utilizing tools and methods
that are accessible to us in accordance with some approach.
 There are several programming languages that are known, but all of them need some
approach when they are implemented, and this methodology/strategy is known as a
paradigm.
 Aside from different programming languages, there are several paradigms to meet every
need.

Admin (n.d.). [online] Available at: https://www.knowledgeboat.com/question/what-


are-the-characteristics-of-procedural-programming--28311496451138200 [Accessed
20 Jul. 2022].
They are discussed below:

 Procedural programming paradigm


 This paradigm places a premium on method in terms of the underlying machine model.
 There is no distinction between the procedural and the urgent approach.
 It provides the ability to reuse code, which was a godsend at the time when it was in use.
*include <iostream>

using namespace std;

int main() I int i, fact = 1, num;

cout << "Enter any Number: ";

cin >> number;

for (i = 1; i <= num; i++) {

fact = fact * i;

cout « "Factorial of " << num « " is: " << fact << endl;

10
return 0;

 Object oriented programming


The software is written as a set of communication-oriented classes and objects. Objects are the
smallest and most fundamental entities, and all computations are conducted on them alone. The
focus is more on data than process. It can handle practically every kind of real-world challenge
that exists today.
import java.io.•;

class GFG {

public static void main(String[] args)

System.out.println("GfG!");

Signup sl = new Signup();

sl.create(22, "riya", "riya2@gmail.com", 'F', 89002);}}

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){

System.out.println("Welcome to GeeksforGeeks\nLets create your account\n");

this.userid = 132; this.name = "Radha";

this.emailid = "radha.89@gmail.com";

this.sex = 'F';

this.mob = 900558981;

System.out.println("your account has been created");

 Event-driven paradigms
o Service oriented
o Time driven
import asyncio

def hello_world(lp): print('Hello World') 1p.stop()

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.

P3: Write a program that implements an algorithm using an IDE:

#include<iostream>

#include<vector>

#include<stdio.h>

#include<cstring>

#include<fstream>

#include<algorithm>

using namespace std;

class course {

public: long int reg;

char name[80],branch[50];

void input() {

cout<<"\n Enter course name: ";

gets(name); cout<<"\n Assign to level: ";

cin>>reg; fflush(stdin);

cout<<"\n Enter course: ";

gets(branch);

} void display()

system("CLS");

void display()

{ system("CLS");

cout<<"\t\tDisplay Records";

cout«"\n"; cout<<"\n Course Name - "<<name;

cout<<"\n Level No. - "<<reg;

12
cout<<"\n Course - "<<branch;

cout«"\n";

system("PAUSE");

system("CLS");

} bool operator == (course a) { if(reg..a.reg) return true;

else return false;

}; vector <course>v;

int search reg(long int reg,int &i);

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++) {

course x=v[i]; f.write((char *) &x,sizeof(class course));

(.close();

} int search reg(long int reg,int { int ta=0;

for(i=0;i<v.size();

i++) if(v[i].reg==reg) { ta=1; break;

} return ta;

} int search name(char name[],vector<int> &vi)

int i,ta=0; for(i=0;i<vesize();

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

M3: Use of an IDE for development of applications:

 The Benefits of Using IDEs


 Integrated development environments help developers be more productive.
 These IDEs increase productivity by reducing setup time, speeding up development
chores, keeping developers up to date on the newest best practices and risks, and
standardizing the development process so that everyone can use it.
Faster setup:
Faster development tasks:
Continual learning:
Standardization:

Admin (n.d.). [online] Available at:


https://www.veracode.com/security/integrated-development-environment
[Accessed 20 Jul. 2022].

D3: Use the IDE to control the program's development process:


 An IDE is used by developers to create, manage, and execute code while their
applications are running.
 It simplifies the development process by abstracting various parts of editing code into
separate apps.
Here are the best available IDEs for Java developers:
IntelliJ IDEA.

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

Learning outcome 4: Importance of a coding standard and debugging process.


P4: Debugging procedure and IDE debugging facilities:
 Debugging is the deliberate process of locating and minimizing the amount of flaws (or
faults) in a computer programmer so that it behaves as intended.
 Debugging is required for two sorts of errors:

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

M4: Evaluate, help develop more secure debugging, robust applications:


 It just cannot. The process of replicating, identifying, and describing "bugs" (defects) in a
system is known as debugging. It's a remedy after those flaws have already been
introduced!
 At best, we may utilize analysis of previous debugging cycles to inspire improved
engineering practices and perhaps as research towards producing better tools to be used
in the software design and engineering process. However, security and resilience are
qualities that must be included in both the design and execution of software.
 Higher-quality software development necessitates stronger quality assurance techniques
and allowing your QA to influence engineering and management choices and practices.
Adopting test driving or behavior driving methodologies, as well as technologies to
support them, may be part of such strategy. Another option is to use agile or extreme
processes.

Admin (n.d.). [online] Available at: https://www.quora.com/How-can-the-debugging-


process-be-used-to-help-develop-more-secure-robust-applications [Accessed 20 Jul.
2022].
D4: Evaluate why a coding standard is necessary:
 For software engineers, coding standards are crucial for various reasons: Maintenance
accounts for 40% to 80% of the entire cost of software.
 The original creator of software usually never completely supports it.
 Coding standards promote software readability by helping developers to comprehend new
code more quickly and effectively.
 Advantages of OOP

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

Admin (n.d.). [online] Available at: https://www.roberthalf.com/blog/salaries-and-


skills/4-advantages-of-object-oriented-programming [Accessed 20 Jul. 2022].
P5: Outline the coding standard you have used in your code:
 OOP code?
 Object-oriented programming (OOP) is a programming approach that organizes software
design around data, rather than functions and logic.
 An object is a data field that has distinct features and behavior.
 Coding standard of oops.
Encapsulation, abstraction, inheritance, and polymorphism are the four object-oriented
programming concepts.
 These words may be frightening to a junior developer.
 And Wikipedia's elaborate, too lengthy explanations may sometimes add to the
confusion.
 That is why I want to provide a concise, concise, and straightforward explanation for
each of these principles.
 It may seem like something you'd tell a kid, but I'd love to hear these responses when I do
an interview.

Admin (n.d.). [online] Available at: https://www.freecodecamp.org/news/object-


oriented-programming-concepts-21bb035f7260/#:~:text=The%20four%20principles
%20of%20object,abstraction%2C%20inheritance%2C%20and%20polymorphism.
[Accessed 20 Jul. 2022].

20

You might also like