Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

ICT2613 Assignment 3 2026 Due 3 August 2026 |Internet Programming|

Beoordeling
-
Verkocht
-
Pagina's
34
Cijfer
A+
Geüpload op
19-05-2026
Geschreven in
2025/2026

This assignment has been carefully put together to give you more than just answers; it walks you through the reasoning behind each one, so you actually understand the material rather than just memorising it. Every solution has been verified for accuracy, with academic references that hold up to scrutiny. Whether you're working through it the night before a submission or using it to reinforce your understanding over time, it's built to be genuinely useful. The explanations are clear without being condescending, and the structure follows what examiners actually look for not just what sounds impressive. If you put in the effort to engage with it properly, distinction-level results are well within reach.

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

UNIVERSITY OF SOUTH AFRICA (UNISA)
College of Science, Engineering and Technology







ASSIGNMENT 3
Year Module — 2026







Module Code: ICT2613

Module Name: Internet Programming

Assignment No.: 3

Due Date: 03 August 2026

Semester: Year Module 2026




Submitted in partial fulfilment of the requirements for Internet Programming
at the University of South Africa.

,UNISA | ICT2613 Assignment 3 — Internet Programming



Task 1: Extracurricular Activity Registration Form (25 Marks)

Chapter reference: 7 | Page name: task1.php

This task requires building a PHP web form that registers school learners for extracurricular
activities, validates the submitted data, and displays a registration summary with fee calcula-
tion.

Display Registration Form




User Submits Form (GET)




All fields
filled?


No Yes


Display error: Display registration
“Form is incomplete” summary and total fee


Figure 1: Task 1 – Form Processing Flow



Question 1: How should the HTML form be structured?


The form uses the GET method as required by the assignment. Each field is labelled clearly.
The grade dropdown is populated programmatically using a PHP loop over grades 1 to 7. Six
extracurricular activities are listed as checkboxes: three are free (Soccer, Netball, Choir) and
three are paid (Chess at R150/term, Pottery at R200/term, Golf at R250/term). The form
also includes a text field for the learner’s full name and a submit button.

Key Distinction
The GET method appends form data to the URL as query string parameters. This is
appropriate for non-sensitive, idempotent operations such as a registration lookup. The



Page 1 of 33

,UNISA | ICT2613 Assignment 3 — Internet Programming



POST method sends data in the HTTP request body and is preferred for sensitive data.
This task explicitly requires GET.



Question 2: How should form validation be implemented?


Three conditions must all be satisfied before processing proceeds:

1. The full name field must not be empty.
2. A grade must be selected (not the default placeholder).
3. At least two checkbox activities must be selected.

If any condition fails, an error message is echoed to the page. If all conditions pass, the regis-
tration summary and total fee are displayed below the form.


Question 3: How is the total fee calculated?


The code iterates over the selected activities. Each activity has a predefined cost (R0 for free
activities). The total is accumulated in a variable and displayed using echo formatted with
South African Rand notation.


Complete PHP Code for task1.php


Listing 1: task1.php – Learner Extracurricular Registration Form
1 <?php
2 // menu . inc is included on every page for navigation
3 include ’ menu . inc ’;
4


5 // Define activities with their costs per term (0 = free )
6 $activities = [
7 " Soccer " => 0,
8 " Netball " = > 0 ,
9 " Choir " => 0,
10 " Chess " = > 150 ,
11 " Pottery " = > 200 ,
12 " Golf " = > 250 ,
13 ];
14 ?>


Page 2 of 33

,UNISA | ICT2613 Assignment 3 — Internet Programming



15 <! DOCTYPE html >
16 < html lang = " en " >
17 < head >
18 < meta charset = " UTF -8 " >
19 < title > Extracurricular Registration </ title >
20 < style >
21 body { font - family : Arial , sans - serif ; margin : 20 px ; }
22 label { display : block ; margin - top : 10 px ; font - weight : bold ; }
23 . error { color : red ; font - weight : bold ; }
24 . success - box { background : # e8f5e9 ; border : 1 px solid #388 e3c ;
25 padding : 15 px ; margin - top : 20 px ; border - radius : 5
px ; }
26 </ style >
27 </ head >
28 < body >
29 <h2 > School Extracurricular Activity Registration </ h2 >
30


31 <?php
32 // Form Processing




33 $errors = [];
34 $formSent = isset ( $_GET [ ’ submit ’ ]) ;
35


36 if ( $formSent ) {
37 // 1. Validate full name
38 $fullName = isset ( $_GET [ ’ fullname ’ ])
39 ? trim ( htmlspecialchars ( $_GET [ ’ fullname ’ ]) )
40 : ’ ’;
41 if ( empty ( $fullName ) ) {
42 $errors [] = " Full name is required . " ;
43 }
44


45 // 2. Validate grade selection
46 $grade = isset ( $_GET [ ’ grade ’ ]) ? $_GET [ ’ grade ’] : ’ ’;
47 if ( empty ( $grade ) || $grade === ’0 ’) {
48 $errors [] = " Please select a grade . " ;
49 }
50




Page 3 of 33

,UNISA | ICT2613 Assignment 3 — Internet Programming



51 // 3. Validate at least two activities selected
52 $selected = isset ( $_GET [ ’ activities ’ ])
53 ? $_GET [ ’ activities ’]
54 : [];
55 if ( count ( $selected ) < 2) {
56 $errors [] = " Please select at least two extracurricular
activities . " ;
57 }
58


59 // Display errors or registration summary




60 if (! empty ( $errors ) ) {
61 echo " <p class = ’ error ’> The form is incomplete . All fields
need "
62 . " to be filled : </p > < ul class = ’ error ’>" ;
63 foreach ( $errors as $err ) {
64 echo " <li > " . $err . " </ li > " ;
65 }
66 echo " </ ul > " ;
67 } else {
68 // Calculate total fee
69 $totalFee = 0;
70 foreach ( $selected as $act ) {
71 if ( isset ( $activities [ $act ]) ) {
72 $totalFee += $activities [ $act ];
73 }
74 }
75


76 // Display registration summary
77 echo " < div class = ’ success - box ’>" ;
78 echo " <h3 > Registration Confirmation </ h3 > " ;
79 echo " <p > < strong > Learner Name : </ strong > " . $fullName . " </p >
";
80 echo " <p > < strong > Grade : </ strong > " . $grade . " </p > " ;
81 echo " <p > < strong > Registered Activities : </ strong > </p > < ul > " ;
82 foreach ( $selected as $act ) {
83 $cost = $activities [ $act ];
84 $costStr = ( $cost == 0) ? " Free " : " R " . $cost . " / term " ;


Page 4 of 33

, UNISA | ICT2613 Assignment 3 — Internet Programming



85 echo " <li > " . htmlspecialchars ( $act )
86 . " ( " . $costStr . " ) </ li > " ;
87 }
88 echo " </ ul > " ;
89 echo " <p > < strong > Total Amount Payable per Term : R "
90 . $totalFee . " </ strong > </p > " ;
91 echo " </ div > " ;
92 }
93 }
94 ?>
95

96 <! - - HTML Form


-->
97 < form method = " GET " action = " task1 . php " >
98


99 < label for = " fullname " > Full Name of Learner : </ label >
100 < input type = " text " id = " fullname " name = " fullname "
101 value = "<?php echo $formSent
102 ? htmlspecialchars ( $_GET [ ’ fullname ’] ?? ’ ’)
103 : ’ ’; ?> " >
104


105 < label for = " grade " > Grade : </ label >
106 < select id = " grade " name = " grade " >
107 < option value = " 0 " >-- Select Grade - - </ option >
108 <?php
109 // Populate grades 1 to 7 using a loop
110 for ( $g = 1; $g <= 7; $g ++) {
111 $sel = ( $formSent && isset ( $_GET [ ’ grade ’ ])
112 && $_GET [ ’ grade ’] == $g ) ? ’ selected ’ : ’ ’;
113 echo " < option value = ’ $g ’ $sel > Grade $g </ option > " ;
114 }
115 ?>
116 </ select >
117

118 < label > Extracurricular Activities ( select at least 2) : </ label >
119 <?php
120 foreach ( $activities as $actName = > $actCost ) {
121 $label = ( $actCost == 0)


Page 5 of 33

Gekoppeld boek

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
19 mei 2026
Aantal pagina's
34
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

€4,34
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
LectureLab Teachme2-tutor
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
647
Lid sinds
2 jaar
Aantal volgers
188
Documenten
1431
Laatst verkocht
7 uur geleden
LectureLab

LectureLab: Crafted Clarity for Academic Success Welcome to LectureLab, your go-to source for clear, concise, and expertly crafted lecture notes. Designed to simplify complex topics and boost your grades, our study materials turn lectures into actionable insights. Whether you’re prepping for exams or mastering coursework, LectureLab empowers your learning journey. Explore our resources and ace your studies today!

3,6

83 beoordelingen

5
32
4
16
3
16
2
4
1
15

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen