Functions in Web Programming Differential Calculus
Functions in Web Programming Differential Calculus
DIFFERENTIAL CALCULUS
Group 1
1
PROFESSOR
Table of contents
Introduction………………………………………………………………………………………………………………………..……………….….3
Body………………………………………..………………………………………………………………………………………………………..…….5
Conclusion……………..……………………………………………………………………………………………………………..……………..…
2
FUNCTIONS IN WEB PROGRAMMING
Web Programming (also known as web development) is the creation of dynamic web
applications. Examples of web applications are social networking sites like Facebook or e-commerce
sites like Amazon. Web programming refers to the writing, markup and coding involved in Web
development, which includes Web content, Web client and server scripting and network security. The
most common languages used for Web programming are XML, HTML, JavaScript, Perl 5 and PHP. Web
programming is different from just programming, which requires interdisciplinary knowledge on the
application area, client and server scripting, and database technology.
In programming, a named section of a program that performs a specific task. In this sense, a
function is a type of procedure or routine. Some programming languages make a distinction between
a function, which returns a value, and a procedure, which performs some operation but does not return
a value. Most programming languages come with a prewritten set of functions that are kept in a library.
You can also write your own functions to perform specialized tasks.
PHP uses the function keyword to tell the language a function is about to be defined. Functions in PHP
are names with underscores (_) instead of empty spaces followed by parentheses () to hold any input
values. The contents of a function in PHP are marked off by curly braces {}. The start of the function
begins with the left curly brace {and ends with the right curly brace {. Every left brace must be matched
with a right brace or PHP will throw an error. ‘’echo’’ is a PHP command that immediately prints
whatever value(s) appear to its right, in this case the $output variable. ‘’echo do double (2)’’ calls and
print outputs the do double () function passing the function the input of 2. The result should be 2 * 2 or
4.
3
return num2;
}
The function name is found Maximum. As can be interpreted from the name, the function is written to
find the maximum of two given numbers. num1 and num2 are two integers passed into the function –
these are the parameters. Notice that the function parameters are placed within parenthesis just after
the function name. The int appearing before the function name denotes that the return type of this
function is an integer. There is also a return statement in the function. This statement returns a value
from the function. This value should be of the type defined as the return type of the function.
A function is a block of organized, reusable code that is used to perform a single, related action.
Functions provide better modularity for your application and a high degree of code reusing. You have
already seen various functions like prints () and main (). These are called built-in functions provided by
the language itself, but we can write our own functions as well and this tutorial will teach you how to
write and use those functions in C programming language.
Good thing about functions is that they are famous with several names. Different programming
languages name them differently, for example, functions, methods, sub-routines, procedures, etc. If
you come across any such terminology, then just imagine about the same concept, which we are going
to discuss in this tutorial.
Let's start with a program where we will define two arrays of numbers and then from each array, we
will find the biggest number. Given below are the steps to find out the maximum number from a given
set of numbers.
4
library These standard libraries System.out.print(“square root of 4 is “+ 2.0
metho come along with the Java Math.sqrt(4));
d Class library that is present }
in Java archive (*. Jar) file }
with JVM and JRE. Hun
11,2021
1. <script>
It returns the sine of the 2. document.writeln(Math.sin(1)+"<br>");
sin() given number. 3. document.writeln(Math.sin(2)); 0.8414709848078
Syntax - Math.sin(num) </script> 965
0.9092974268256
817
1. <script>
It returns the tangent of the
2. document.writeln(Math.tan(1)+"<br>");
given number. 3. document.writeln(Math.tan(2)); 1.5574077246549
tan() Syntax - Math.tan(num) </script> 023
-
2.1850398632615
19
It returns the cosine of the
1. <script>
given number. 2. document.writeln(Math.cos(-1)+"<br>");
Syntax - Math.cos(num) 3. document.writeln(Math.cos(-0.5)); 0.5403023058681
cos() 4. </script> 398
0.8775825618903
728
A. What is a method and what are its properties that are mathematical functions?
Methods are functions attached to specific classes where functions are associate to the set value
of x and the set value of y. Programming functions is somehow related to mathematical functions,
where the set of formulas will follow the process.
5
Example of programming function in determining the average using the number of elements.
In the other hand, if values are given in mathematical expressions, we simply use the average method.
Like,
1. Enter number: 45.3
2. Enter number: 67.5
6
3. Enter number: -45.6
4. Enter number: 20.34
5. Enter number: 33
6. Enter number: 45.6
What can go into a function is called a domain. What can possibly result from a function called a
codomain. What actually comes from a function is called a range. What goes out of a scope depends on
what we put in the domain, but we can define the domain in fact, the domain is an integral part of the
function. We change the domain and we have a different function. Although both functions take the
input and square it, they have a different set of outputs. While domain, codomain, and range are
actually three more vocabulary terms to know, they are also useful concepts to master by thinking
about them, you can understand the behavior of a function or relationship to understand. By
determining the range and codomain of a function before you start graphing, you generally develop a
mental picture of a function that can help you avoid mistakes or wasting space on your graph paper
when graphing the function.