Professional Documents
Culture Documents
La Lucia
INFORMATION TECHNOLOGY
Grade 11
Paper 02: Practical
Examiner : S. Govender
Moderator : A.J. Pillay
1) Ensure that you are writing the correct exam paper, and that there are no missing pages.
2) Create a Folder on the Network drive of the account you have been logged into.
Ensure that the name of your folder is your FULL Name.
3) Use this folder to save ALL your work in and nowhere else on the PC Hard drive.
5) Save your work every 5 minutes to prevent loss of work in case of a power failure/disruption.
7) At the end of the session, you are required to make printouts of ALL your efforts.
8) Alert the invigilator immediately if you have hardware or software related problems with the PC that
was allocated to you. Do not waste time by trying to resolve the issue by yourself.
9) Your programs must be coded in such a way that they will work with any data and not just the sample
data supplied or any data extracts that appear in the question paper. You are advised to look at the
supplied data files carefully.
10) Make sure that routines such as searches, sorts and selections are developed from first principles, and
that you do not use the built-in features of a programming language for any of these routines.
The company has a database called Sweets4Africa.mdb that is used to maintain its stock.
The database contains two tables, Stock and Suppliers. The Stock table contains details of
all stock items being sold. The Suppliers table contains the details of the various suppliers of
for stock items. One Stock item can only be supplied by one Supplier, but a supplier can
supply more than one stock item.
The design and sample content of these tables are described below:
Stock:
You are required to extract some useful information from the database as well as make
required changes to assist Sweets4Africa to analyse data from the database.
QUESTION 1
1.1 Write a query that will list the StockName and CostPrice for all stock, sorted in
ascending order of cost price. (3)
1.3 Write a query that will list the StockName and Quantity of all stock that contains
“mint” anywhere in the name of the stock.
StockName Quantity
Mint Imperials (1 x 200g) 517
Mint Imperials (24 x 75g) 990
Smoothies Mint (1 x 72’s) 700
Smoothies Supa Mint (1 x 50’s) 162 (3)
1.4 Items of stock with large quantities on hand, usually mean that they are not selling
well. The value for each item of stock is determined by multiplying the item’s cost
price with its quantity on hand. Write a query that will determine the total value of
ALL items of stock where items of stock have a quantity of 500 or more. (4)
1.5 Some stock items have not been allocated a supplier. Write a query to change the
supplier to Beacon (Supplier ID 1), for all these stock items. (5)
1.7 Write a query that will list SupplierName and Avg (a calculated field of the average
cost price of all items supplied by the supplier, to TWO decimal places), in
descending order of Avg. (7)
[30]
Sweets4Africa is looking at creating a Point of Sale (POS) system to meet the demands
of growing sales and to ensure better record keeping. They are currently looking to hire
a software development company to create the POS for them, using the agile module
approach.
This application will keep track of items sold during each sale and provide statistical
information for analysis.
You have been given a text file named “Sales.txt” which contains data about the sales
and items sold in the order of the sales made. A sample of the first 6 lines of the file is
given below:
Create a Java application called Sweets4Africa. Please ensure that you insert the
question numbers as comments in your code, before answering the questions.
Use the class diagram below to create a new class called ItemSold. The
diagram below indicates the properties/fields and methods that are required.
ItemSold
Properties:
‒ salesID : integer
‒ stockName : string
‒ costPrice : double
‒ markUpPerc : double
‒ qty : integer
Methods:
+ Constructor(inSID : integer , inSN : string, inCP : double, inMUP : double ,
inQty : integer)
+ getSalesID : integer
+ getStockName() : string
+ getQty() : integer
‒ getItemPrice() : double
+ getItemTotal() : double
+ toString() : string
2.2 Write code to create the properties for the ItemSold class as indicated in the class
diagram. (3)
2.3 Write code to create the constructor method as indicated in the class diagram. (3)
2.4 Write code to create the accessor methods getSalesID, getStockName and
getQty. (1)
2.5 Write code to create the method getItemPrice that determines and returns the
price of the item.
2.6 Write code to create the method getItemTotal that determines and returns the
sales total for the item: Item Price × Quantity (2)
2.7 Write code to create the method toString that will return the details of an item on
one line, in a columnar format as follows, with the Item Total formatted to TWO
decimal places:
stockName<tab><tab>qty<tab><tab>ItemTotal (3)
[16]
Use the class diagram below to create a new class called ItemsSoldManager.
The diagram below indicates the properties/fields and methods that are
required.
ItemSoldManager
Properties:
‒ arrItemsSold []: ItemSold [100]
‒ counter : integer
Methods:
+ Constructor(filename : string)
‒ sortItems()
+ displayItems() : string
+ mostQty() : string
+ saleTotals() : string
3.2 Write code to create the class variables as indicated in the class diagram:
3.2.2 counter, an integer variable to keep track of how many sold items are
stored in the array (1)
• accepts a String as a parameter that represents the name of the text file to be
read from
• runs through the text file and reads data from each line in order to create
ItemSold objects for the array (13)
3.4 Write code to create the method sortItems that will sort the sold items in the array
in ascending order of the stock name. (10)
3.5 Write code to create a method displayItems that will display the sorted items sold,
with suitable headings. (6)
3.6 Write code to create a method mostQty that will determine and return the name of
the stock that had the highest quantity, for any sale. (7)
saleID<tab><tab>total
Sample Return:
SalesID Total
1 162.33
2 216.75
.
.
. (8)
[48]
QUESTION 4
4.1 Write code to create a simple user interface called ItemsSoldUI that will allow
simple output. (1)
4.3 Write code to call the salesTotal method to display the totals of each sale.
Sample Output:
SalesID Total
1 162.33
2 216.75
3 88.81
.
.
. (1)
4.4 Write code to call the displayItems method to display the items sold.
Sample Output:
Sample Output:
[6]
TOTAL: 100