Practice on Formulas in PHP

Задание 1

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.

Задание 2

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.

Задание 3

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.

Задание 4

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.

Задание 5

Let a variable tc with the temperature in degrees Celsius be given. Using the appropriate formula, convert this temperature to degrees Fahrenheit.

Задание 6

Let a variable tf with the temperature in degrees Fahrenheit be given. Using the appropriate formula, convert this temperature to degrees Celsius.