100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary ICT3612 ( Advanced Internet Programming) $11.67   Add to cart

Summary

Summary ICT3612 ( Advanced Internet Programming)

 49 views  1 purchase
  • Course
  • Institution

The purpose of this document is to provide assistance and guidance in completing Assignment Two (3612).

Preview 2 out of 7  pages

  • June 19, 2023
  • 7
  • 2022/2023
  • Summary
avatar-seller
This document serves as a guideline for Assignment Two (3612) and provides detailed explanations.
Please note that by providing this disclosure, I, acknowledge that I am not liable for any marks
awarded to you or any copyright claims resulting from the use of this guideline.

Disclaimer:

While every effort has been made to ensure the accuracy and reliability of the information provided
in this guideline. It is your responsibility to critically evaluate and adapt the information to meet the
specific requirements of your assignment.




QUESTION 1



<?php

//WRITE THE FUNCTION BELOW AS PER THE QUESTION. NO CODE TO INVOKE THE FUNCTION
SHOULD BE INCLUDED HERE

//NO HTML ALLOWED. ONLY PHP CODE IS ALLOWED

function findLongestString(...$strings) {

$maxLength = 0; // Variable to store the length of the longest string



foreach ($strings as $str) {

if (is_string($str)) { // Check if the argument is a string

$length = strlen($str); // Get the length of the string



if ($length > $maxLength) { // Update maxLength if the current string is longer

$maxLength = $length;

}

}

}



return $maxLength;

}



// Test the function

, $strings = array("Test", 123456, "On");

$longestLength = findLongestString(...$strings);

echo $longestLength; // Output: 4



?>



QUESTION 2



<?php

//WRITE THE FUNCTION, INVOKE THE FUNCTION, DISPLAY RESULT BELOW AS PER THE QUESTION.

//NO HTML ALLOWED. ONLY PHP CODE IS ALLOWED



$generateRandomNumbers = function($start, $end, $count) {

$numberRange = range($start, $end); // Create an array of numbers within the range

shuffle($numberRange); // Shuffle the array randomly

return array_slice($numberRange, 0, $count); // Return the desired number of random numbers

};



$randomNums = $generateRandomNumbers(1, 50, 6);

foreach ($randomNums as $num) {

echo $num . " "; // Output each random number separated by a space

}




?>




QUESTION 3



<?php

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller phegelelo. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $11.67. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

83225 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$11.67  1x  sold
  • (0)
  Add to cart