Professional Documents
Culture Documents
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, Explanation, Problem and Example:.........................................................................2
M1: Application Programming process...............................................................................................2
D1: Implementation of algorithm........................................................................................................2
Learning outcome 2: Characteristics of procedural, object-orientated and event-driven
programming.............................................................................................................................................3
P2: Explanation, Features, and Relationships:...................................................................................3
M2: Compare, Contrast used with a source code of an application:.................................................3
D2: Critically Evaluation, code structure and characteristics...........................................................9
Learning outcome 3: Using an IDE, write fundamental algorithms in code.......................................10
P3: Write a program that implements an algorithm using an IDE:................................................10
M3: Use of an IDE for development of applications:............................................................................15
D3: Use the IDE to control the program's development process:........................................................16
Learning outcome 4: Importance of a coding standard and debugging process................................16
P4: Debugging procedure and IDE debugging facilities:..................................................................16
M4: Evaluate, help develop more secure debugging, robust applications:.....................................17
D4: Evaluate why a coding standard is necessary:............................................................................18
P5: Outline the coding standard you have used in your code:.........................................................18
1
Learning outcome 1: Define basic algorithms to carry out an operation and
outline the process of programming an application.
P1: Algorithm, Explanation, Problem and Example:
An algorithm is a set of instructions that a computer must follow in order to perform calculations
or other problem-solving activities. A formal definition of an algorithm is a finite collection of
instructions that must be executed in a certain sequence to fulfil a stated goal.
Characteristics:
Language independent, Input, Output, Finiteness, Validity
2
Document your procedure.
// function declaration
int main ()
int a = 10;
int b = 20;
int res;
std::cout << a << "+" << b << "=" << res << std::endl;
3
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
public:
// Function to set the person's data
4
void setvalue()
{
cout << "Enter name\n";
cin.ignore();
5
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;
6
// 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;
7
break;
case 4:
b.showbal();
break;
case 5:
b.withdrawl();
break;
case 6:
exit(1);
break;
default:
cout << "\nInvalid choice\n";
}
}
}
call event-handler for event_nn with event parameters else handle unrecognized event // ignore or raise
exception
end loop
8
elax [online] Available at:
https://www.assignmentexpert.com/homework-answers/programming-and-
computer-science [Accessed 22 Jul. 2022].
D2: Critically Evaluation, code structure and characteristics.
The ideas of objects and classes are fundamental to object-oriented programming. In Java,
classes are referred to as templates for objects, and objects are instances of a class, thus the
objects may inherit all of the class's traits, variables, and functions.
The notion of procedural calls gives rise to the moniker "procedural programming." It has
benefits and limitations similar to other programming paradigms. Take note of them and
compare them to your needs to see if the common programming paradigm is suitable for you.
fact = fact * i;
cout « "Factorial of " << num « " is: " << fact << endl;
return 0;
9
import java.io.•;
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
Service oriented, Time driven
import asyncio
1p = asyncio.get_event_loop()
1p.call_soon(hello_world, 1p)
1p.run_forever() 1p.close()
#include<vector>
10
#include<stdio.h>
#include<cstring>
#include<fstream>
#include<algorithm>
class course {
char name[80],branch[50];
void input() {
cin>>reg; fflush(stdin);
11
cout<<"\t\tDisplay Records";
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;
12
1++) if(strcmp(v[i].name,name)==0)
Figure 1
Figure 2
13
Figure 3
Figure 4
Figure 5
14
Figure 6
Figure 7
15
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:
Eclipse.
NetBeans.
IntelliJ IDEA.
Visual Studio.
Common features of an IDE
IDEs have been around for decades.
IDEs have evolved and changed throughout time, from being only a platform for debugging and
testing to an integrated piece of software that may act as an extension of the developer.
Text editor:
Debugger:
Compiler:
Code completion:
elax (n.d.). [online] Available at: https://www.sitepoint.com[Accessed 22 Feb. 2022].
Debugging facilities
The ability to run or halt the target program 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 program execution are all common
debugging features. If a section of code produces unexpected results, consider executing it in
isolation. elax (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 26 Jul.
2022].
16
Figure 8
Figure 9
17
elax (n.d.). [online] Available at: https://www.quora.com/How-can-the-debugging-
process-be-used-to-help-develop-more-secure-robust-applications [Accessed 21 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.
Benefits of OOP
Data Redundancy
Polymorphism Flexibility
Re-usability
Code Maintenance
Security
Easy troubleshooting
Coding standard
Encapsulation, abstraction, inheritance, and polymorphism are the four concepts of object-
oriented programming. These are daunting words for a new programmer. And Wikipedia's
complex, too long explanations may sometimes add to the confusion. That is why I want to offer
a short review of each of these principles. It may seem to be something you'd say to a child, but
I'd love to hear these comments when I conduct an interview. elax (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 22 Jul. 2022].
18