Practice on Formulas in PHP
Let a variable r with the radius of
a circle be given. Using the appropriate formula, find
the area of the circle and write it to the variable
s. Display the contents of this variable
on the screen.
Let a variable a with the side
of a square be given. Find the area of the square and write
it to the variable s. Display the contents
of this variable on the screen.
Let variables a and b
with the sides of a rectangle be given. Find the area
of the rectangle and write it to the variable
s. Display the contents of this variable
on the screen.
Let variables a and b
with the sides of a rectangle be given. Find the perimeter
of the rectangle and write it to the variable
p. Display the contents of this variable
on the screen.
Let a variable tc with the temperature
in degrees Celsius be given. Using the appropriate formula,
convert this temperature to degrees
Fahrenheit.
Let a variable tf with the temperature
in degrees Fahrenheit be given. Using the appropriate
formula, convert this temperature
to degrees Celsius.