0% found this document useful (0 votes)
33 views32 pages

Information Technology P2 2023

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

Information Technology P2 2023

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

TOTAL

MARKS

Please paste the barcoded


label here

NATIONAL SENIOR CERTIFICATE EXAMINATION


NOVEMBER 2023

INFORMATION TECHNOLOGY: PAPER II

EXAMINATION NUMBER

Time: 3 hours 150 marks

PLEASE READ THE FOLLOWING INSTRUCTIONS CAREFULLY

1. This question paper consists of 32 pages. Please check that your question paper is
complete.

2. Read the questions carefully and make sure that you answer all parts of all the
questions.

3. Answer ALL the questions on the question paper and hand this in at the end
of the examination. Remember to write your examination number in the space
provided.

4. Show all working where applicable.

5. A non-programmable calculator may be used.

6. It is in your own interest to write legibly and to present your work neatly.

7. One blank page (page 32) is included at the end of the paper. If you run out of space
for a question, use this page. Clearly indicate the number of your answer should you
use this extra space.

FOR MARKER'S USE ONLY

Question 1 2 3 4 5 6 7 8 Total
Marks 10 10 25 10 30 15 20 30 150
Marked

Moderated

Re-Mark

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 2 of 32

SECTION A SHORT QUESTIONS

QUESTION 1 DEFINITIONS

Give the most appropriate term for each of the following expressions:

1.1 A program which converts source code into machine code, line by line.
interprter
(1)

1.2 The part of the machine cycle which translates the instruction into CPU commands.
decode

(1)

1.3 A form of network transmission where packets are transmitted to all nodes on the
network rather than a specific device.
Broadcast

(1)

1.4 A memory management technique where secondary storage can be used as if it


were main memory.

Virtual memory
(1)

1.5 Reorganising the data stored on an HDD into contiguous blocks.


Defragmentation

(1)

1.6 The portion of a packet which contains the data being transmitted.
Payload
(1)

1.7 An older communications technology which simultaneously transmits voice and data
over public telephone networks using copper cable.
ADSL

(1)

1.8 Software which protects a computer against malicious programs.


Anti virus
(1)

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 3 of 32

1.9 A secure data transmission protocol for viewing Internet pages with a web browser.
HTTPS
(1)

1.10 Software which redirects traffic through a network of servers to avoid being traced
and which uses layered encryption for protection.
VPN
(1)

10 marks

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 4 of 32

SECTION B SYSTEM TECHNOLOGIES

QUESTION 2 THEORY

For each of the terms in Column A below, you should select the most correct definition in
Column C, matching the letter to the question number. You should merely write down the
appropriate letter in Column B. An example is shown as Question 2.0, using 'W' as the
correct answer.

Column A Column B Column C


2.0 W
2.1 SSD L A A motherboard path which connects the
CPU and main memory
2.2 Register C B A computer interface used to connect
storage devices
2.3 CMOS I C A portion of the CPU used to store the
current instruction
2.4 IO Range D A semiconductor chip which stores
N
instructions to load the basic computer
hardware on start-up
2.5 Virtual memory M E A software license which allows free use of
software
K
2.6 Compiler F A list of the available IRQs a device can use
2.7 BIOS D G A form of cloud storage
2.8 Freemium O H Converting and executing source code line
by line
2.9 SATA I A semiconductor chip which stores
B
computer configuration data
2.10 FSB A J An interface which allows hot swappable
devices to connect with the motherboard
K Software used to convert source code into
object code
L A storage device which has no mechanical
parts
M A technology which allows segments of
memory to be stored in pages on a hard
drive
N A buffer used to speed up a slow input-
output device
O A software license which allows free use of
restricted features of software
P The temporary storage of hard drive data in
RAM to increase secondary storage access
speed
[10]
IEB Copyright © 2023
NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 5 of 32

SCENARIO

Consider the following scenario when answering the rest of the examination paper unless
otherwise stated or the questions are of a general nature.

Fairly Fit is a fitness centre being established in a local shopping mall. They offer customers gym
facilities such as a weights room, swimming pool and sauna, and a health food café.

QUESTION 3 APPLICATION

The business owners will need various computer hardware items for the fitness centre. To
reduce start-up costs, they have purchased a second-hand server with the following
specifications:

• Intel Xeon CPU 8 cores 3.3 Ghz


• 2 CPU slots (1 filled)
• 20 MB L3 cache
• DDR3 RAM
• 8 RAM slots
• 3 x 2 TB HDD
• Supported RAM chips: 2 GB, 4 GB, 8 GB, 16 GB and 32 GB
• 4 × USB 3 slots
• Intel onboard graphics card

3.1 Give an example of ONE device which will connect to a server via USB.
Mouse
(1)

3.2 The specification doesn't state how much RAM there is on the motherboard.

What is the maximum amount of RAM which can be installed using:

RAM chip capacity Total amount of RAM

2 GB 8*2 = 16gb

32 GB 8*32 = 256

(2)

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 6 of 32

3.3 An operating system is critical to the operation of any computer.

3.3.1 What are the THREE basic functions of any operating system?

Function 1:
Provide a user interface.

Function 2:
Load and execute applications.

Function 3:
Manage computer's resources.

(3)

3.3.2 The server does not include an operating system. Complete the following table
to suggest an operating system suitable for the server in this scenario. You
need to:

• name ONE operating system,


• give ONE reason to justify your choice, and
• name the license model used for the operating system.

Name of operating
Justification for choice License model used
system
Windows
Open source
Widly used

(3)

3.4 Users often wish to improve the performance of computers.

3.4.1 The specifications state two CPU slots, although only one is currently used. If
a second processor is added, would this be considered a co-processor?
Justify your answer with ONE reason

YES yes NO

Justification:
A co-processor is defined as being any additional processor added in

order to assist a CPU. This can be a second CPU, a GPU, a math co-
processor.
(2)

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 7 of 32

3.4.2 Multitasking and multithreading are two commonly used techniques to


improve performance. Define each of these concepts and give ONE example
of how each can improve performance.

Multitasking

More than one task being performed at one time.


The execution of more than one program
Definition: simultaneously.
Concurrent execution of multiple tasks.

Running multiple browsers at the same time.


Running Word and Excel at the same time.
Example: Running a browser and a music program at the same
time.

(2)

Multithreading

Allows for two or more instruction threads to be

executed independently.
Definition: Ability to break a single process into multiple threads
of execution and run them simultaneously.
A single set of code being able to be broken into
separate threads and run by multiple processors at the
same time.

Playing a video and downloading it at the same time.


Example: Browser accepting input from the user and is fetching
data at the same time.

(2)

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 8 of 32

3.4.3 The processor has 20 MB of Level 3 cache.

(a) What type of RAM is used in processor caches?


static ram

(1)

(b) Will it be possible to increase the size of the L3 cache to improve the
performance of the CPU further? Justify your answer with ONE reason.

no
YES NO

Justification:
L3 Cache RAM is part of the motherboard construction, not
modular, so cannot be swapped out/changed/increased/
improved.

(2)

(c) Caches can either be 'shared' or 'unshared'. Shared means that each
core of the processor makes use of the same cache memory. Explain
why Level 1 cache is more likely to be unshared compared to Level 3,
which is often shared.

L1 is more likely not to be shared as it is smaller and closer to


the CPU

(1)

3.4.4 The server has an onboard graphics card.

(a) TRUE or FALSE: An onboard graphics card makes use of system


RAM. Support your answer with ONE reason.

TRUE X FALSE

A graphics card needs RAM in order to


manipulate the graphics – if there is only an
onboard card, the system RAM is all that will be
Reason: available.

(2)

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 9 of 32

(b) Regarding the current scenario, would you recommend that the owners
use an additional graphics card in the server? Justify your answer with
ONE reason.

YES NO
no
Justification:
For a server, the onboard graphics card will be sufficient; there
will not be graphics-demanding applications run on a server; a
server should have sufficient RAM installed, won't notice the
difference in performance.
(2)

(c) Name TWO components that will be present on a dedicated graphics


card that improves a computer's overall performance.

Component 1:
GPU

Component 2: VRAM

(2)
[25]

35 marks

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 10 of 32

SECTION C INTERNET AND COMMUNICATION TECHNOLOGIES

QUESTION 4 THEORY

For questions 4.1 to 4.5, you need to select the most correct answer from the options
A–D. An answer grid is at the bottom of this page for your answers. You merely need to
write down the appropriate letter for your answer.

4.1 DHCP …

A is a protocol used to setup transmission security.


B is a protocol used to allocate IP addresses to devices.
C is a protocol to allow data transfer on mobile networks.
D is a protocol used to link URLs and IP addresses. B (1)

4.2 Thin clients …

A are only used on cabled networks.


B are used to reduce server processing requirements.
C are devices with minimal processing ability.
D are commonly used in most school networks. C (1)

4.3 MAC addresses …

A uniquely identify network cards.


B uniquely identify nodes on a network.
C uniquely identify switch ports. A
D None of the above. (1)

4.4 Ethernet …

A is a commonly used LAN protocol.


B uses ARP (Address Resolution Protocol) to identify devices.
C allows for different transmission speeds on the same network.
D
D All of the above. (1)

4.5 Video on demand …

A can only be offered on a cabled network.


B eliminates the constraint of static broadcast schedules.
C always uses the UDP protocol for transmission. B
D is usually offered as a free service. (1)

Question 4.1 4.2 4.3 4.4 4.5

Answer

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 11 of 32

4.6 Two techniques to compress data are lossy and lossless compression.

4.6.1 For each of the characteristics listed below, you must indicate whether each
applies to lossy or lossless compression. You need to tick the appropriate box.

Letter Characteristic Lossy Lossless


A Removes as much data as possible from
the original file X
B Doesn't allow for significant storage savings X
C Data quality, especially for video images, is
X
compromised
(3)

4.6.2 For TWO of the three characteristics above, explain why you chose lossy or
lossless compression. Name the characteristic and then write your
explanation.

Characteristic 1 Explanation
Circle the Lossy – The reason behind compressing
characteristic letter files is to make them smaller; lossy
A/B/C removes as much as possible to make the
file as small as possible.

Characteristic 2 Explanation
Circle the
characteristic letter Lossy – In order to reduce the size of the
A/B/C file, data is removed and therefore the
quality of the image will be reduced as
some parts of the image are no longer
there.

(2)
[10]

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 12 of 32

QUESTION 5 APPLICATION

Fairly Fit need some advice regarding the network which they are installing. The network will
need to connect laptops and mobile devices used by the gym, the café, and customers. The
business will also have a website allowing customers to purchase gym contracts, gym clothing
and order food from the café.

5.1 Fairly Fit have been given the following network design:

The only cabled connections will be to the server and the wireless access points. All
other devices will connect via a wireless connection. In the diagram, two wireless
access points are shown – there will be significantly more than this in the installation.
IEB Copyright © 2023
NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 13 of 32

5.1.1 What is the function of a wireless access point?

To allow for nodes to connect to a wireless network; creates a wireless


LAN; provides wireless connectivity to nodes.

(2)

5.1.2 State ONE advantage and ONE disadvantage for laptops and mobile devices
using only wireless connections. Your answers may not be the opposite of
each other.

Advantage: flexibility in connectivity.


Easy for multiple users to connect.

A device without a WLAN card will not be able to


Disadvantage: connect to the network.
Less secure than cabled network.

(2)

5.1.3 Which topology does the network design use? Justify your answer with ONE
reason that highlights this network topology's characteristic.

Topology name:

Central device is being used to connect all


nodes to the core of the network.

Reason:

(3)

5.2 It is important that all the wireless traffic is encrypted.

5.2.1 What is meant by the term 'encrypted' when referring to network traffic?

data packets which travel across the network are unable


to be read as plain text; original data is converted into ciphertext;
readable format vs encoded format.

(2)

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 14 of 32

5.2.2 The wireless access points used by Fairly Fit offer 256-bit encryption. 256 bit
refers to the length of the key used to encrypt the data stream.

(a) How many different combinations would a potential hacker need to try
to break an encrypted message? Write your answer as a power/
exponent.
2^256

(1)

(b) The encryption technique used by the wireless access points is


symmetric encryption. Name and describe ONE feature of symmetric
encryption which is a weakness of the encryption technique.

Name:
Symmetric encryption uses the same key to encrypt and decrypt
data packets. Therefore, if the key which was used to encrypt the
Describe: packets is known by a third party, they will be able to decrypt the
data. This poses a security threat. Uses one private key.

(2)

(c) There is an encryption technique which overcomes the weakness of


symmetric encryption. What is this technique, and how does it improve
the encryption process?

Technique: Asymmetric encryption

Different keys are used to encrypt and


decrypt data packets. Public key is used to
Improvement: encrypt, private key is used to decrypt.

(2)

(d) List ONE disadvantage of the technique you explained in (c) above.

Should the decryption key (private key) be lost, data packets


will not be able to be decrypted.
Asymmetric is slower than symmetric encryption.
(1)

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 15 of 32

5.3 The network diagram shows a device called a Firewall.

5.3.1 What is the purpose of a firewall in a network?

A firewall is designed to prevent unwanted access to private data on


a network; to filter packets on a network; provides protection from
external attacks.

(2)

5.3.2 The owners of Fairly Fit have asked why it is necessary to have a firewall on
their network. State and explain TWO reasons why their network should have
a firewall, given that the network will be used by employees, gym users and
café customers.

Gym users are going to be able to connect to the


network.
There is a website connected to the network.
Reason 1: Second mark is to be allocated for the explanation of
the reason; reference to the particular type of user.
For example: Gym users connecting to the network
could pose a risk; OR Fairly Fit might want to block
certain traffic types.

The network is being used for customers to purchase


goods.
Second mark is to be allocated for the explanation of
Reason 2: the reason. For example: If customers are using the
website to purchase goods, there needs to be a level
of protection against hacking the store.

(4)

5.4 Customers have requested more interaction opportunities with the website, allowing
food to be ordered from the café.

5.4.1 Explain why the website will make use of Web 2.0 principles.

Because it offers users the ability to interact with it in a variety of ways.

(1)

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 16 of 32

5.4.2 List TWO types of information which customers could post to the website after
ordering food from the café.

A review of the food ordered


Type 1:
A review of the service received (good/bad)

Type 2: Photographs of the food


Video of the food being eaten
Type 2:

(2)

5.4.3 Customers could also use social media to communicate their experiences with
Fairly Fit. Name TWO social media platforms which Fairly Fit could use for
this purpose.

Instagram
Platform 1:

Youtube
Platform 2:

(2)

5.4.4 Add-on features on a website are often made possible by using scripting.

(a) Distinguish between server-side and client-side scripting.

The script is run on the server (remote) and


Server-side: the result is sent to the client's browser.

Client-side:

The script is sent to the client's browser and


Client-side: is executed locally and the result shown
directly in the browser.

(2)

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 17 of 32

(b) List TWO website features which make use of client-side scripting that
will be useful to users when ordering food from the café

A calculator to add up the value of items


Feature 1:
purchased.

Feature 2: Login screen – entering username and


Feature 2: password for validation.

(2)
[30]

40 marks

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 18 of 32

SECTION D SOCIAL IMPLICATIONS

QUESTION 6

Read the following text about security concerns over the app 'TikTok'. This text has been
paraphrased from the cited sources. You should then answer the questions that follow.

Universities in at least 10 US states have taken steps to ban the use of the popular app TikTok on
campus Wi-Fi networks. The ban affects both staff and students.

Several US states and the federal government have also banned TikTok from government-owned
devices due to concerns about the app's data collection and the Chinese company that owns it.
Similar bans have been put in place in India and at the European Commission due to security
concerns.

The app collects a large amount of user data, which could potentially offer sensitive information
to the Chinese government. The head of the FBI has also expressed concerns about the app's
data collection and its potential to spread Chinese state influence operations.

ByteDance, the company that owns TikTok, has not been transparent about how data flows
between its US and China operations, raising concerns about its practices. Last month, a major
US magazine reported that TikTok's parent company tracked journalists' IP addresses to identify
which employees were sharing unauthorised information.

However, TikTok remains popular globally, with over 1 billion users, and the bans in the US at
university level are unlikely to impact the app's popularity significantly. However, a greater ban
(for example, country-wide) would substantially impact US users.
[Sources: <https://techcrunch.com/2023/02/23/european-commission-orders-staff-to-remove-tiktok-from-
work-devices/>
<https://techcrunch.com/2023/01/19/tiktok-college-bans-texas-bytedance/>]
The contents of this text was simplified using ChatGPT.

Glossary

TikTok : TikTok is a popular social media app that allows users to create, watch, and share videos created on
mobile devices or using webcams.

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 19 of 32

6.1 Cyber security is the term used to describe all methods individuals and companies
use to reduce the risk of an attack that will result in data loss.

Name ONE hardware device or software application that reduces the risk of a cyber
attack.

(1)

6.2 Give TWO reasons why you believe TikTok has become such a successful and
popular social media platform.

Reason 1:

Reason 2:

(2)

6.3 List THREE types of information which TikTok might collect and possibly be made
available to the Chinese government. You should briefly explain how each of these
might be useful.

Information type Useful nature

(6)
IEB Copyright © 2023 PLEASE TURN OVER
NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 20 of 32

6.4 The article states that bans on campus networks are unlikely to make the app less
popular. Give TWO ways a university student might still be able to use the app while
on campus when TikTok is banned.

1:

2:

(2)

6.5 A student, who uses TikTok, has stated that they don't believe that their personal
information is at risk as they merely use the app as a non-registered user (without
creating an account). Do you believe this to be true? Justify your answer with ONE
reason.

YES NO

(2)

6.6 Fairly Fit is considering creating its own app for gym and café customers. Suggest
to the owners TWO methods to ensure that their customer's data used by the app is
secure.

Tip 1:

Tip 2:

(2)

15 marks

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 21 of 32

SECTION E DATA AND INFORMATION MANAGEMENT AND SOLUTION


DEVELOPMENT

QUESTION 7

To manage their day-to-day business operations, Fairly Fit have many different IT solutions
using both databases and OOP-designed applications.

7.1 Data stored or transmitted across a network can often be subject to threats. Consider
a database which Fairly Fit use to store details of their gym and café customers.

7.1.1 Explain what each of the following threats to quality data means and give a
possible example of how customer data could be affected in the Fairly Fit
database.

Outdated data

Definition

Example

Invalidated data

Definition

Example

(4)

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 22 of 32

7.1.2 Customers using the Fairly Fit website need first to log in. A hacker is
attempting to log into the website and steal customer information. All
information about every customer is stored in a table called tblCustomers.
The hacker has made up a CustomerID (harry0209) and typed in the
following line into the CustomerID field on the webpage:

SELECT *
FROM tblCustomers
WHERE CustomerID = 'harry0209' OR 1=1;

(a) Entering a SQL statement into a web page field is a malicious SQL
technique. What name is given to this technique?

(1)

(b) Explain what this line of SQL code will achieve.

(2)

(c) Why will this achieve what you have explained in (b) above?

(2)

(d) What can be done to ensure that a SQL statement such as that shown
in part (b) above is not executed?

(1)

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 23 of 32

7.2 IP addresses are stored in a fixed number of bits. An IPv6 IP address consists of
eight 16-bit fields, each separated by a colon (:). Each 16-bit field has four
hexadecimal characters, each using 4 bits.

Here is an example of a valid IPv6 address:

2001:0db8:0000:0000:0000:ff00:0042:8329

Alternating 16-bit fields are shown in different colours for clarity.

7.2.1 How many bits will be required to store one IPv6 address?

(1)

7.2.2 IPv6 addresses are long and difficult to work with, so several techniques can
be used to shorten an IPv6 address without losing its uniqueness. One way
of achieving this is by removing leading zeros, ensuring at least one character
remains in each of the 16-bit fields.

Applying this technique to the IP address shown above, we would end up with
the following address:

2001:db8:0:0:0:ff00:42:8329

Now consider the following IPv6 address:

2001:0db8:3c4d:0015:0000:0000:002f:000b

Once again, the alternating 16-bit fields have been shown in different colours
for clarity.

(a) Write out this IPv6 address in shortened format using the technique
described above. The first two fields are shown for you.

2001 : db8 :
(2)

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 24 of 32

(b) Assume that because we have a shorter IPv6 address, we can use
fewer bits to store the address. Use the table/grid below to work out
how many bits will be needed to store the shortened IPv6 address from
(a) above. The first two blocks have been filled in for you.

Field Number of bits

2001 16

db8 12

Total number of bits:


(4)

(c) The shortening technique used above suppressed leading zeros. Why
is it not possible to remove trailing zeros as well? Use the field ff00 to
assist in answering this question if necessary.

(3)
[20]

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 25 of 32

THIS PAGE IS INTENTIONALLY LEFT BLANK.

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 26 of 32

QUESTION 8

8.1 One of the programs used by Fairly Fit is used to store and work with details of
various food items which are sold in the café. The program makes use of objects to
hold relevant information and is made up of many different classes.

The Stock Class

This class will be used to instantiate Stock objects, one object for each stock item
bought for sale in the café. Each Stock object will have the following fields:

description : string
stockQuantity : integer
costPrice : real
sellingPrice : real
healthyFood : boolean

These fields should only be accessible from the Stock Class.

Additionally, the class will need to have the following class fields:

markup : integer – this value is fixed at 60


totalStock : integer – this represents the total number of all food items in stock
totalCost : real – this represents the total cost price of all food items in stock
totalSales : real – this represents the total value of all food items sold

Except for the markup field, these fields should only be accessible from the Stock
class.

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 27 of 32

Complete the following class diagram for the Stock class. Show the declaration of
additional fields as well as the following methods:

Stock Class

• Parameterised constructor method accepting the following parameters: d (string),


sQ (integer), cP(real), sP (real), hF (Boolean);
• Accessor methods for the healthyFood and stockQuantity fields;
• Mutator method for the description field, which will accept a parameter dIn
(string)
• Accessor method for the totalStock field
• A toString() method to combine the various fields of a Stock object into a string.

Stock
Fields:
- description : string
- stockQuantity : integer
- costPrice : real
- sellingPrice : real
- healthyFood : boolean

Methods:

(8)

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 28 of 32

8.2 An array of Stock objects called sArr exists which shows the stock of all food items
at any one time. An example of data that is stored in the array is shown below:
description Lentil Salad
stockQuantity 8
sArr[0] costPrice 5.50
sellingPrice 8.80
healthyFood Yes

description Power Oats


stockQuantity 15
sArr[1] costPrice 4.00
sellingPrice 6.40
healthyFood Yes

description Protein Wrap


stockQuantity 4
sArr[2] costPrice 10.50
sellingPrice 16.80
healthyFood Yes

description Prego Steak


stockQuantity 15
sArr[3] costPrice 12.80
sellingPrice 20.48
healthyFood No

Fairly Fit has a policy that at all times, their stock of healthy food items must be
greater than or equal to 80% of their total stock of food items. For example, if they
have 50 items in stock, then at least 40 of these must be healthy food items.
Consider the following algorithm which has been designed to alert the café manager
if the stock of healthy food items drops below 80% of all items in stock. This algorithm
will be tested against the sample data in sArr.

method testHealthyFood() : String


begin
1 totalStock  30
2 size  4
3 count  0
4 alertLevel  0.00
5 alert  “Level OK”
6 for k  0 to size – 1 inc by 1
begin
7 if sArr[k].getHealthyFood() = true
begin
8 count = count + 1
end if
end for
9 alertLevel  count / totalStock (real division)
10 if alertLevel < 0.80
begin
11 alert  “Level Low”
end if
12 return alert
end method
IEB Copyright © 2023
NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 29 of 32

8.2.1 (a) What method will be called to access the value of the variable
totalStock?

(1)
(b) You must complete the following trace table to show the algorithm's
actions. You MUST include the line numbers as a reference to the line
of code in the algorithm. There are more lines on the grid than are
necessary for a correct answer.

sArr[k].getHealthyFood() alertLevel
Line totalStock size count alert alertLevel k Return
= 'true' ? < 0.80

(11)

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 30 of 32

8.2.2 Line 8 of the algorithm is currently incorrect.

(a) Explain what is wrong with this line of code.

(2)

(b) Correct the line of code so that the correct result will be achieved.

(2)

8.3 Fairly Fit would like to incentivise customers who use the gym and eat healthy meals
in the café to lose weight. They wish to apply the following conditions:

• A customer has eaten 10 healthy meals – let this equal M


• A customer has used the gym 5 times – let this equal G
• A customer is within 5 kg of their target weight – let this equal W

Fairly Fit will reward any customer who has eaten 10 healthy meals and used the
gym 5 times, OR any customer who has not eaten 10 healthy meals but has used
the gym 5 times and is within 5 kg of their target weight. This condition can be written
as the following Boolean expression:

F(M,G,W) = (M.G) + (M'.G.W)

IEB Copyright © 2023


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 31 of 32

Complete the following truth table to represent the condition


(M.G) + (M'.G.W).
RESULT
M G W M' M.G M'GW M.G + M'GW
True/False

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

(6)
[30]

50 marks

Total: 150 marks

IEB Copyright © 2023 PLEASE TURN OVER


NATIONAL SENIOR CERTIFICATE: INFORMATION TECHNOLOGY: PAPER II Page 32 of 32

ADDITIONAL SPACE (ALL QUESTIONS)


REMEMBER TO CLEARLY INDICATE AT THE QUESTION THAT YOU USED THE
ADDITIONAL SPACE TO ENSURE THAT ALL ANSWERS ARE MARKED.

IEB Copyright © 2023

You might also like