0% found this document useful (0 votes)
34 views9 pages

Correction Mock 2023

Uploaded by

Eva Tomi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views9 pages

Correction Mock 2023

Uploaded by

Eva Tomi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

CORRECTION MOCK 2023

1- An algorithm is a step-by-step problem to procedure a result. Key words( step by step, task,
result, instruction, problem).

The need of an algorithm is that:

 it improves the needs the efficiency of an existing technic.


 To compare the performance of an algorithm with respect to other technics.
 The algorithm reduces the cost of design
 With the help of an algorithm, we can measure and analyze the complexity, time and space of
the problem.
 We can measure the performance of the method in different cases. (Best case, worst case and
average case).
2- Complexity of an algorithm is a way to classify how efficient an algorithm is compared to
alternative ones. These efficiencies can be measure in time, space and length.
3- A data structure is a way of defining, storing, and retrieving data in a structural and systematic
way. Example of data structure: graph, tree, LinkedList, array, stack, queue.
4- Define the following:
- Stack: is a type of data structure that respect the LIFO principle that means the last element to
come out
- Queue data structure: is data structure similar to a stack. It is opens at both ends. On end is
always used to insert data(enqueue) and the other end is used to remove data (dequeue).

A queue uses the FIFO methodology that is the item stored first will be accessed first.

- A graph: is a pictorial representation of a set of objects where some pair of Object are connected
by links. The interconnected objects are represented by points called vertices and the link that
connect vertices are called edges.
- Tree: minimalist connected graph having no loop and circuits.
5- Define a flowchart and pseudocode and give example each.
6- 02 operations available in the stack:
- Push: it adds an item to the top of the stack. The overflow condition occurs if the stack is full.
- Pop: it removes the top item of the stack. If the stack is empty, an underflow condition occurs.
- Top: this returns the top item from the start.
- IsEmpty: it returns true of the stack is stack is empty otherwise false.
- Size: returns the size of the stack.
7- 2 operations of queue and explain:
- Front: it returns the frontend element without removing it.
- Rear: returns the rear end element without removing it.
- Enqueue adds an element to rear end of the queue.
- Dequeue removes an element from the front end of the queue

An overflow condition occurs if the queue is full.

An underflow condition occurs if the queue is empty.


8- We determine computer algorithm by determining the amount of memory or size the algorithm
requires.

II- event programming

1- A .net framework is a software developed by Microsoft windows to builds desktop applications.

A .net framework can also be a template or collection of libraries develop by Microsoft windows for the
development of applications. App develop on the .net framework can only run on Windows os.

It uses the following programming languages: C#, j#, c++, vb.net.

2- vb.net program (solved)


3- Dim as a statement in vb.net is used to declare the value of the function.

IV- OBJECT ORIENTED PROGRAMMING:

1- Define:
- Polymorphism: is the ability of an object to take on many forms or the capability of a method to
perform an action based on the object it is acting upon.
- Method overloading: is the type of method that has the same name but different parameters or
return type.
- Exception is an unexpected error that occurs during the execution of a program.
- An Abstraction is the process of hiding certain details and showing only essential one to the user.

Things to know about abstract class:

- Abstract class cannot be instantiated


- Abstract class can have an abstract method with no implementation.

2) convert the class diagram into a program

Class Person {

Private string name;

WEB DESIGN (HTML5, CSS3, JAVASCRIPT, PHP)

- URL: it’s a unique identifier of a resource on the world wide web.

Parts of the URL:

 Domain name
 Extension
 Protocol
 Directory
 File

The order is: protocol-domain-extension-directory-file.


The forward slash should be like this: //

The port for http is: 80 or 8080

The port for https is: 41

The port for ftp is: 21.

- JavaScript: is an object-oriented scripting language for web development.


- PHP: high end server scripting language used for development dynamic and interactive web
pages.
- MySQL is an open-source relational database management system.
- PDO is a clean and consistent way to access databases in PHP. It stands for PHP Data Object.
- UX: is the look and feel of an application.
2- Differentiate between a front end and a back-end developer:
The front-end developer is the developer that handles the part of the page that we can see while
a back-end developer handles the part of the page we cannot see.

The front-end developer deals with the UI and the UX while the back-end developer deals with UX.

The front-end developer uses technologies as HTML, CSS and React, Vue while the back-end
developers use technologies as Laravel, Node JS, MongoDB, MySQL.

3- Pop-up boxes available in JavaScript:


4- What is the Document Object Model: It defines the way of manipulating the logical structure of
documents and how they are accessed. Using Nodes and Objects.
5- A responsive web design is the development interactive and dynamic webpages.

SECTION D: NETWORKING

1- A network is a set of interconnected objects with the objective to share resources.

A node is an end point on a computer network.

A network topology is the layout pattern of how the computer are set on the network.

It is also the physical or logical arrangement of node in the network.

2- IP classes are different ranges of grouping IP addresses.

An IP address has 4 sets of numbers. Each set with a value up to 255. The range of the home or
commercial connection starts between 190 or 10. IP classes are differentiated based on the number
of hosts it supports on a single network. If an IP class supports more networks, then very few IP
address are available on each network. On a local environment, the default IP is 127.0.0.1.

The android emulator uses the IP 10.0.2.2.

The IP 127.0.0.1 is the IP reserved for localhost connection while the localhost is the domain name
server of the 127.0.0.1.
DNS stands for Domain Naming Server. It acts as a translator between domain name and IP
addresses. Translating a domain name into numbers or IP address is called Forward LookUp.
Translating an IP address into a domain name is called Reverse LookUp.

A HUB is a device that is used to share information on the network without storing the address of
the device. A HUB will broadcast all data to every port.

A SWITCH is a device that will create a dynamic connection and provides information to the
requesting port without broadcasting it to the others.

If all the nodes are connected to a single cable, it is referred to as a linear bus topology.

If a device needs to communicated with another in star topology, the it has to send the signal to the
central device. The central device sends the same signal to the destination device.

Signal in a ring topology flows only a single direction from one device to another and reaches the
destination node. In this topology, each device of the network, is connected to two other devices on
either side in a form of a loop.

On the Mesh topology, each device is connected to all other devices of the network. It uses routing

To calculate the number of connections on the mesh topology, we se the formula

N=n(n-1)/2. Where n is the number of nodes. The two types of mesh topology are the half mesh and
full mesh topology.

Disadvantage: it is very expensive to set up are requires huge cabling.

HND 2021 CORRECTION

2-b- differentiate between algorithm and program language:

- An algorithm is executed by a person while a program is executed by a computer.


- An algorithm can be understood and written by non-programmers while a program can only be
written by programmers.
- An algorithm is written in plain English while a program is written in a programming language.
- Step by step logical approach to solve a problem while a program is a block of codes written that
follows programming languages.
- Constant definition in C

Const datatype variable name value

#define variable name value;

- The difference between CBV and CBR is that in CBV, values of variables are passed by simple
technics while in CBR a pointer variable is necessary to define and store the address of the value.
- In CBV there is no modification in the original value while in CBR there is a modification of the
original value.
- The programming languages that use CBV are C++, VB.Net, C#.
- Precedence refers to the order of operation. Operator precedence specifies how 2 expressions
can be binded together.

Example: 1+5*3 is 16 and not 18 because multiplication has a higher precedence than addition.

PRECEDENCE AND ASSOCIATION:

- (): Evaluated first. If nested, evaluate inner most first.


- *, /, %: evaluate second. If there are several, evaluate Left to right (LTR).
- +, -: evaluate third. If several, evaluate left to right.
- =: evaluate last, right to left.

MOCK 2020 CORRECTION

Define:

- Modularity: it is the breaking down of a problem into modules.


- Differentiate between an abstract class a concrete class:
 An abstract class cannot be instantiated while a concrete class can be.
 An abstract class may or may not have an abstract method while a concrete class must not have
an abstract method.
 Abstract class is declared using the modifier abstract while concrete cannot be declared using
the modifier abstract.
 Abstract class cannot be declared as final while concrete class can be declared as final.
- Types in inheritance:
comments on hybrid inheritance: it is implemented by combining more than one type of
inheritance.

VI- OOM-UML

CLASS Attributes Methods


Flight flightID, depAirport, ArrAiport, Departure(), Land()
arrTime, depTime, flightStatus;
Airline airlineID, airlinrName; addAirCraft(), remveAirCraft()
Airport airportID, airportName, RegFlight();
AirportLocation;
Pilot pilotName, expLevel, pilotRole, OperateFlight();
pilotID;
Co-pilot Same as pilot Same as pilot
Aircraft AircraftID, aircraftName, setWorkingStatus(),
landingStatus, workingStatus setLandingStatus();
Captain Same as pilot Same as pilot
Relationship:

- An airline operates flights


- Flight has many pilots
- Airlines has a set of pilots
- Airlines owns a set of aircrafts
- Flight uses an aircraft
- Flight has one airport as departure airport and one airport may be the departure airport of many
flights. (Same for arrival).

Notation Meaning
0…1 Zero or one
1 One only
0…* Zero or more
* Zero or more
1….* One or more
7 Seven only
0….2 Zero or two
4….7 Four to seven

EXERCISE 2:

1- How is it possible for JavaScript to be used as back-end programming language?

With the use of Node JS, we have permit programmers to use JavaScript as backend language.

JavaScript library are: JQUERY AND AJAX

JAVASCRIPT FRAMEWORK are: Vue js, React, BabylonJs, Angular..

CSS framework are: Tailwind CSS, Boostrap, AnimationsCSS.

PHP Framework are: Laravel, Symphony, CodeIgniter, CakePHP.

JavaScript is used to create dynamic web applications.

2- It is possible to implement web pages without JavaScript.


3- The process of deploying a web application built locally is:
- Get a domain name
- host the project.
- Make sure the server you have support the domain name you are hosting.

A website is a combination of webpages while a web application is a webpage that is run on the browser.

4- Tools to develop a PHP project are:


- IDE such as VSCODE, JB PHPStorm, EasyPHP.
- Webserver
- Web browser
- Database.
5- Create a form with HTML and CSS.
6-

A Firewall is a software component that is used to prevent unauthorized access on the network.

The person to contact to have internet connection is the Internet Service Provider (ISP).
CORRECTION MOCK SIANTOU

SECTION A: COMPUTER PROGRAMMING AND ALGORITHM

I- ALGORITHM
1- These cases are important concept because they are used to evaluate important concept. They
are method of analyzing algorithms, taking into account the amount of times it takes the
algorithm to run in each scenario.
 Best case: it focuses on computing the minimum amount of processing time required for any
given set of inputs. Let us consider a linear search algorithm as an example. The best case occurs
when x is present in the first location.
 Worst case: it defines the input for which the algorithm takes more time or input for which the
algorithm runs the slowest. For a linear search problem, the worst case occurs when the element
to be search doesn’t exist in the array. The worst case time complexity of a linear search
algorithm is the O(n) where n is the number of cases.
 Average case: Here we run the algorithm for any number of iterations, then compute the
running time for each trial, sums it, and divide by the total number of trials.

total running time


Ave. Case =
number of trials
N.B: We take all possible inputs and calculate the computational time of all the inputs. Add up all
calculated values and divide by the sum of total number of inputs. This case is rarely done in
practical cases because we must predict the mathematical cases of all possible inputs.

For a linear search problem, all the cases must be uniformly distributed. We add all the cases and
divide by the total number of cases.

2- Write a flowchart and pseudocode to have user enter 3 numbers and compare them:

Pseudocode:

Start

Enter 3 numbers a,b,c

If a>b and a>c

Display a is the maximum

Else

If b>c and b>a

Display b is the maximum

Else display c is the maximum

End
FLOWCHART:

In flowchart, this symbol is for input output

This symbol is for operation

This symbol is for condition

And the arrows are called connectors.

The four basics concepts if OOP are: inheritance, encapsulation, abstraction and polymorphism.

Difference between data hiding and encapsulation.

Data Hiding Encapsulation


Uses access private modifiers Uses private, public and protected access
modifiers
It is a data protecting process It is a method of achieving data hiding
Is focuses on securing the data while hiding the It focuses on hiding the complexity of the
complexity system.

You might also like