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
Samenvatting

Summary Assignment 1 and Assignment 2 – Internet Programming (ICT2613 – 2025)

Beoordeling
-
Verkocht
-
Pagina's
5
Geüpload op
02-05-2025
Geschreven in
2024/2025

Assignment 1 and 2 – Internet Programming (ICT2613 – 2025) Please note: This document contains Assignments 1 and 2 for the module Internet Programming ICT2613 for the year 2025 answers

Instelling
Vak

Voorbeeld van de inhoud

Assignment 1 and 2 – Internet Programming (ICT2613 – 2025)




Please note:
This document contains Assignments 1 and 2 for the module Internet Programming ICT2613 for the year 2025.
It is intended to serve as a guide. You are strongly advised not to copy and paste answers directly without
verifying the correct process for submission on myUnisa.
Use the content provided to understand the structure, extract what is relevant, and ensure your submission
complies with the module requirements.
Questions are indicated in red, while the corresponding answers are provided below each one.



Assignment 1 (chapters 1-6), Due Date: 13 May 11:00 PM, Total marks: 32 marks


1 = A (client-server application)
2 = D (PHP interpreter)
3 = C (Apache)
4 = B (uses localhost as the domain name)
5 = A (.htm)
6 = A (Code two slashes (//) followed by the comment)
7 = B (echo $votingAge;)
8 = B (POST)
9 = B (Name: Bob)
10 = B (20)
11 = B (foreign keys)
12 = C (SELECT)
13 = A (if the values of the primary key and foreign key are equal)
14 = B (a WHERE clause)
15 = A (http://localhost/phpmyadmin)
16 = B (PHP Data Objects)
17 = C (DSN (Data Source Name))
18 = A (fetch())
19 = C (PDOException object)
20 = C (foreach statement)
21 = D (the model and the view)
22 = A (make each layer as independent as possible)
23 = D (the application runs more efficiently)
24 = A (Model-View-Controller)
25 = A (controller)
26 = D (syntax error)
27 = D (multiplying by the wrong variable)
28 = A (runtime error)

, 29 = C (logic)
30 = A (fix all errors)


Assignment 2, Due Date: 23 June 11:00 PM, Total Marks: 60

Question 1 (10 marks)

<?php
// Check if form is submitted
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = htmlspecialchars($_POST["name"]);
$language = $_POST["language"];

// Language greetings mapping
$greetings = [
"English" => "Hello",
"Afrikaans" => "Hallo",
"IsiXhosa" => "Molo",
"IsiZulu" => "Sawubona",
"Setswana" => "Dumela"
];

// Display greeting
if (array_key_exists($language, $greetings)) {
echo "<h2>" . $greetings[$language] . " " . $name . "</h2>";
} else {
echo "<h2>Invalid language selected.</h2>";
}
}
?>

Question 2 (10 marks)
Write a PHP program that inputs a number representing seconds and computes and displays the number of hours,
minutes and seconds from the input number.
For example, if the input is 5000 seconds, it is equivalent to 1 hour, 23 minutes and 20 seconds. Note that a minute
is 60 seconds and an hour is 60 minutes.

<?php
// Process form submission
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$totalSeconds = (int)$_POST["seconds"];

// Calculate hours, minutes, and seconds
$hours = intdiv($totalSeconds, 3600);
$remainingSeconds = $totalSeconds % 3600;
$minutes = intdiv($remainingSeconds, 60);
$seconds = $remainingSeconds % 60;

// Display the result
echo "<h2>$totalSeconds seconds is equal to: </h2>";
echo "<p>$hours hour(s), $minutes minute(s), and $seconds second(s)</p>";
}

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
2 mei 2025
Aantal pagina's
5
Geschreven in
2024/2025
Type
SAMENVATTING

Onderwerpen

$15.80
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.
phegelelo University of South Africa (Unisa)
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
17
Lid sinds
3 jaar
Aantal volgers
15
Documenten
12
Laatst verkocht
1 jaar geleden

5.0

1 beoordelingen

5
1
4
0
3
0
2
0
1
0

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