Swe Practical 101310

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

REPUBLIC OF CAMEROON REPUBLIC OF CAMEROON

Peace-Work-Fatherland Peace-Work-Fatherland
…………... …………...
MINISTRY OF HIGHER EDUCATION MINISTERE DE L’ENSEIGNEMENT SUPERIEUR
…………... …………...
NATIONAL COMMISSION FOR THE COMMISSION NATIONAL D’ORGANISATION
ORGANIZATION OF THE HIGHER DE L’EXAMEN DU HND
NATIONAL DIPLOMA EXAM (HND) ……………
……………

Field: COMPUTER ENGINEERING


Specialty: COMPUTER ENGINEERING
Option: SOFTWARE ENGINEERING
Exam Paper: PRACTICE OF COMPUTER
Credit value :8
Duration: 5 HOURS
NATURE OF EXAM: PRACTICAL
Code: SWE 20
2023 SESSION

SECTION A: PROGRAMMING (50 marks)

I. STRUCTURED PROGRAMMING ( in c programming language) (25 marks)


a. The strength of the password system relies on the fact that the value MUST be TRUE to
have access. Write a program that prints “enter the passdigit” the first time , gets a value
from the user and keeps printing “enter the correct passdigit” until the correct value is
entered and prints “condition is satisfied, you may have access”. The value of the passdigit
is “1234” [4 mks]
b. Write a c program that swaps two integers passed by reference. The program should show
function declaration, function definition and function call. Prompt the user to enter two
integers. Display them before and after the call of swap function. First write the program
in your answer sheet before implementing practically [3 mks]
c. Write a recursive function to take the value 3 to the power of another number. For example,
if 4 is passed, the function will return 81. . First write the program in your answer sheet
before implementing practical [3 mks]
d. An election consist of five candidates Paul Biya, Kamto , Joeshua Osi,Cabral Linii, Adamou
Dam Njoya . Create an array of structures to store names, age and the number of votes of
each voter. Each polling station has registered voters. We are considering only one polling
station and we are not managing cases of double voting or identification before voting. The
program will prompt a poling stating to enter the number of registered voters in that station.
Then the program will prompt all the users to vote a single candidate using a do while loop.
When the voter casts a vote, the number of votes of that particular voter is incremented.
Using your knowledge in pointers and their relationship with arrays, display the election
results starting from the winer to the worst loser. The result should be displayed in a table
comprising all information stored about all the candidates.[15 mks]

II. OBJECT ORIENTED PROGRAMMING ( In C++ or Java ) (25 marks)


a. Imagine a publishing company that markets both book and audiocassette versions of its
works. Create a class publication that stores the title (a string) and price (type float) of a
publication. From this class derive two classes: book, which adds a page count (type int),

Page 1 of 5
and tape, which adds a playing time in minutes (type float). Each of these three classes
should have a getdata() function to get its data from the user at the keyboard, and a
putdata() function to display its data. Write a main() program to test the book and tape
classes by creating instances of them, asking the user to fill in data with getdata(), and
then displaying the data with putdata(). [15 mks]
b. Start with the publication, book, and tape classes of Exercise .a. bove, Add a base class sales
that holds an array of three floats so that it can record the dollar sales of a particular
publication for the last three months. Include a getdata() function to get three sales amounts
from the user, and a putdata() function to display the sales figures. Alter the book and tape
classes so they are derived from both publication and sales. An object of class book or tape
should input and output sales data along with its other data. Write a main() function to create
a book object and a tape object and exercise their input/output capabilities. [5 mks]
c. Assume that the publisher in Exercises a. and b. decides to add a third way to distribute
books: on computer disk, for those who like to do their reading on their laptop. Add a disk
class that, like book and tape, is derived from publication. The disk class should incorporate
the same member functions as the other classes. The data item unique to this class is the
disk type: either CD or DVD. You can use an enum type to store this item. The user could
select the appropriate type by typing c or d. [5 mks]

SECTION B: DATABASE DEVELOPMENT AND ADMINISTRATION (20 marks)

A. A new school has just been created in town and they are about creating their data
base using mysql. The school secretary recorded some information about new
students enrolled to study some particular courses. The table also shows the
courses with their respective course codes taken by each student

1. Arrange the table in the first 1NF 2mks


studentId Name address Tel age CourseTitle CourseCo
de

1 Tubuo Carefou-obili 679200671 21 C programming PR111

Database DB112

2 Fotabe omnisport 692056145 19 Web PR113

678889556 Analysis AN113

66990934 Data structures DA114

2. What is an anomaly? 1mk


3. Explain delete , update, insert anomaly as seen in the table in 1NF 2mks
4. Arrange the table in 2NF 2mks
5. Explain how the anomalies above have been resolved 2mks

Page 2 of 5
3 Nabi SNEC-EMIA 654151770 45 Web PR113

Database DB112

Analysis AN113

4 Chafa Biamassi 677003311 41 Moral education MO114

69202567

6. Draw an ER diagram 2mks

B. Consider the following database tables

Customer

Customerid Name Address

CUST01 TUBOU BAFANG

AA ASONG KAMBE

CUST03 NEBA SANGMALEMA

Order_product

Ordered Product Customerid Date

1 Oil CUST01 10/10/2022

2 Shoes CUST01 15/01/2023

3 Sugar CUST03 02/09/2022

4 Oil CUST02 05/12/2022

1- Using any DBMS of your choice, create a database with the tables below. Then
answer the questions. (2mks)
2- for each customer list the orders. (1mks)
3- list the orders and products of Mr. Romuald (2mks)
4- which product is mostly asked? (2mks)
5- On which date Mr. Frank put in an order? (2mks)

Page 3 of 5
SECTION C: WEB DESIGN (15 marks)

a) Consider the following HTML form

i) Write the HTML code that generates the above form (3 marks)
ii) Write a javascript code that ensures all data must be entered before a successful
submission. The code should ensure that the correct standard email is entered
(2marks)
iii) Create a text file called hnd2023.txt where you will populate it with form data
collected using php. Also write php codes to collect the file data to an html table.
3mks
iv) Write a PHP code that ensures all data must be entered before a successful
submission. The code should ensure that the correct standard email is entered
(2marks)
v) Create a database called school with a table called SWE and collect and insert the
form data into it. (3marks)
vi) Create php codes to display the data from the database table in an html form(2marks)

SECTION D: NETWORKING (15 marks)

Objectives:
You have to create a simple Local Area Network, connect computers with each order. You
should create share folders on each computer and exchange files and folders from any
computer to the others. The IP addresses for each computer are as follows:
 PC1: 172.25.200.90 255.255.0.0
 PC2: 172.25.200.91 255.255.0.0
 PC3: 10.25.200.92 255.255.0.0
Equipment needed:

Page 4 of 5
 Three (03) computers equipped with a NIC
 One (01) switch or Hub
 Three (03) copper cross-over cables
Note: Obtain equipment and resources for the lab.
1- Using the correct Ethernet cable, connect the workstations together. Connect one end of the
cable to the NIC port on PC1, PC2 and PC3 and the other end to the switch. (3mks)
2- Apply the Layer 3 addresses to the workstations. (3mks)
Note: The steps to complete this task may differ slightly if you are using Windows XP or Windows 7
operating system.
3- On each computer in order to test connectivity open the DOS command. (3mks)
Network topology:

PC1

PC2
SWITCH

PC3

Sharing a document between PCs

1- On the desktop of PC1, create a new folder and name it test. (1mks)
2- Share that folder and give full access to any user on the network. (3mks)
3- From the PC2 or PC3, place a file in the folder test created in PC1. (2mks)

Page 5 of 5

You might also like