Question
The following set of short questions will focus on getting you familiar with how to write PHP functions as well as how to make use
The following set of short questions will focus on getting you familiar with how to write PHP functions as well as how to make use of the pre-existing PHP functions. All your PHP functions must be declared in the document body section and each functions name must be as specified below. To demonstrate the functionality of each method, you must make function calls in the document body. Include a heading (h1 h6) that indicates the function is being tested before the function demonstration. The use of Global Variables is forbidden!
A) Function: findSummation
Parameter(s): A positive integer number (default value is =1)
Given the input positive number (N), find the summation of all positive integer numbers from 1 to N (1+2+3+.+N) and return this summation. If the input parameter is not a number, or if it is not a positive number return false.
B) Function: uppercaseFirstandLast
Parameter(s): String
For each word in the input string, capitalize (uppercase) both the first letter and the last letter and return the modified string.
C) Function: findAverage_and_Median
Parameter: An array of numbers.
Calculate the average and median of the numbers and return both values.
D) Function: find4Digits
Parameter: A string of numbers separated by spaces.
Return the first four-digit number in the string; false if none.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started