Anda di halaman 1dari 7

Reg. No.

: 2000/000752/07

MAIN CAMPUS
292 SMITH STREET
DURBAN
4000

FACULTY OF INFORMATION TECHNOLOGY

DIPLOMA IN INFORMATION TECHNOLOGY


(SYSTEMS DEVELOPMENT)

nd
2 YEARS

ACADEMIC YEAR 2017

ASSIGNMENT BOOKLET

Page 1 of 21
Registered with the Department of Education as a Private Higher Education Institution under the Higher
Education Act, 1997. Registration Certification No. 2000/HE07/008

NB: 1. Candidates are advised to read the guide lines.


2. For reference use prescribed, recommended books and other source you may come
across.
3. Correct referencing carries 10 Marks.

GUIDELINES

The purpose of an assignment is to ensure that the Learner is able to:


 Use methods of enquiry and research in a disciplined field.

 Interpret and evaluate text.

 Have a sound understanding of key principles and theories, rules and awareness.

 Solve unfamiliar problems using correct procedures as well as investigate and critically
analyse information and report thereof.

 Present and communicate information reliably and coherently.

Instructions and guidelines for writing assignments

1. Use the correct cover page provided by the institution.

2. All essay type assignments must include the following:


2.1 Table of contents
2.2 Introduction
2.3 Main body with subheadings
2.4 Conclusions and recommendations
2.5 Bibliography

3. The length of the entire assignment must have minimum of 5 pages. Preferably typed with font
size 12
3.1 The quality of work submitted is more important than the number of assigned pages.

4. Copying is a serious offence which attracts a severe penalty and must be avoided at all costs. If
any learner transgresses this rule, the lecturer will retain the assignments and ask the affected
learners to resubmit a new assignment which will be capped at 50%.
5. Use the Harvard referencing method.

Page 2 of 21
ASSIGNMENTS DUE DATE

Module Due Date Signature

Internet Programming 621 10 May 2017


RICHFIELD GRADUATE INSTITUTE OF TECHNOLOGY (PTY) LTD
FACULTY OF INFORMATION TECHNOLOGY

INTERNET PROGRAMMING 621


ST
1 SEMESTER ASSIGNMENT
6
Name & Surname: _________________________________ ICAS No: _________________

Qualification: ______________________ Semester: _____ Module Name: __________________________

Date Submitted: ___________

ASSESSMENT CRITERIA MARK EXAMINER MODERATOR


ALLOCATION MARKS MARKS
MARKS FOR CONTENT
QUESTION ONE 25
QUESTION TWO 15
QUESTION THREE 20
QUESTION FOUR 40

TOTAL MARKS 100


MARKS FOR TECHNICAL ASPECTS
1. TABLE OF CONTENTS 0
2. LAYOUT AND SPELLING 0
3. REFERENCE 0
TOTAL MARKS 0
TOTAL MARKS FOR ASSIGNMENT 0
Examiner’s Comments:

Moderator’s Comments:

Signature of Examiner: Signature of Moderator:

Page 15 of 21
QUESTION ONE (25 MARKS)

1.1 Compare and contrast the if/elseif control structure with the switch control
structured and provide coded examples to sustain your answer. (10)

1.2 Use loops and control structures create a program that grades the following list of
students given the grade table below:

The list of students and marks


Name Marks Marks Range Grade
Sauer Jeppe 75 70+ Distinction
Von Weilligh 44 50-69 Pass
Troy Commisioner 60 0-49 Fail
Paul Krugger 62
Jacob Maree 70

For example:
Sauer Jeppe scored a Distinction. (15)

QUESTION TWO (15 MARKS)

2.1 Using multidimensional arrays; create a program that stores 3 arrays, with each
array storing 3 elements.

For example:

HCIT student: Name: Joe Slovo


Gender: M
DOB: 07.05.1990
DIT student: Name: Adam Louis
Gender: M
DOB: 13.12.1989
BSC student: Name: Nonhlanhla Empangeni
Gender: F
DOB: 07.05.1992 (15)

QUESTION THREE (20 MARKS)

3.1 Write a function countWords($str) that takes any string of characters and finds the
number of times each word occurs. You should ignore the distinction between
capital and lowercase letters, and do not have to worry about dealing with
characters that are not letters. Hint: Create an associative array mapping word
keys to the number of times they occur. You will need to look at PHP's string
functions to split a sentence into words.

Page 16 of 21
Hint 2: The print_r($array_name) function is useful for examining the contents of an array.

3.2 In the same file, write a form consisting of a single text field and a submit button. The
“action” attribute to the form should be the same page that the form is on (don’t hard
code, use $_SERVER*‘PHP_SELF’+). The form should send the contents of the text field
via GET.

Upon submitting the form, you should be redirected to the same page, but the URL
should contain the string from the text field as a GET request normally behaves.

Side note: Prevent security vulnerabilities with $_SERVER*‘PHP_SELF’+. For more


information, take a look here: http://www.html-form-guide.com/php-form/php-
form-actionself.html

3.3 Check for the existence of a GET request. If a GET request exists with the name of the
input field that you made in Part 2, run the contents of the request through your
countWords($str) function. Take the output array of the function, and display an HTML
table of words and the number of times they occur. Make the table sorted by
decreasing number of occurrences.

QUESTION FOUR (40 MARKS)

4.1Write a PHP script named states.php that creates a variable $states with the value”Mis-
sissippi Alabama Texas Massachusetts Kansas”. The script should perform the following
tasks:

 Search for a word in $states that end in xas. Store this word in element 0 of an array
named $statesArray.
 Search for a word in $states that begin with k and ends in s. Perform case-insensitive
comparison. Store this word in element 1 of $statesArray.
 Search for a word in $states that begin with M and ends in s. Store this element in
element 2 of the array.
 Search for a word in $states that ends in a. Store this word in element 3 of the array.
 Search for a word in $states at the beginning of the string that starts with M. Store this
word in element 4 of the array.
 Output the array $statesArray to the screen.
[20 marks]
4.2Write a PHP script that tests whether an e-mail address is input correctly. Verify that the
input begins with the series of characters, followed by the @ character, another series of
characters, a period(.) and a final series of characters. Test your program, using both
valid and invalid e-mail addresses.

[10 marks]
4.3Write a PHP script to calculate and display average marks, five lowest and highest marks.
Recorded marks : 78, 60, 62, 68, 71, 68, 73, 85, 66, 64, 76, 63, 75, 76, 73, 68, 62, 73, 72,
65, 74, 62, 62, 65, 64, 68, 73, 75, 79, 77, 89, 90, 52, 65, 75, 80.

Example :

Average Mark is : 70.6


List of seven lowest marks : 60, 62, 63, 63, 64..
List of seven highest marks : 76, 78, 79, 81, 85..

[10 marks]

TOTAL (100 MARKS)

Anda mungkin juga menyukai