As part of the submission for this Lab, you will create your own Web page that u
ID: 3684767 • Letter: A
Question
As part of the submission for this Lab, you will create your own Web page that uses both HTML and PHP to create several different tables providing specific information. You will get a chance to use most of the concepts you studied so far in this course as you will apply both HTML and PHP code to this exercise.
Specifically, you will create a Web application that provides 3 different tables. Each table will consist of at least 2 rows and 2 columns. You may need to add more cells depending upon how you subdivide your display.
The first table should include the results of using PHP to calculate the area and circumference of a circle, the area and perimeter of a rectangle, the area and perimeter of a right triangle and the area and perimeter of a square. The values used for dimensions are as follows:
Shape
Values and parameters
Circle
radius = 2.65 meters
Rectangle
length = 4.2 meters; width = 5.6 meters
Right Triangle
base = 10.2 meters; height = 5.4 meters
Square
length = 5.3 meters
The geometric shape table should include an image of each shape along with the calculated values. Note, you must use PHP and formulas to calculate the results in the application. No hard-coding of results is allowed. The following is a reasonable representation of the first table:
Circle
Area = XX square meters
Circumference = XX meters
Rectangle
Area = XX square meters
Perimeter = XX meters
Right Triangle
Area = XX square meters
Perimeter = XX meters
Square
Area = XX square meters
Perimeter = XX meters
Hint: Use an existing image on the web or create our own. Scaling of images to recommended size is not needed.
14
The second table should include a famous quote (or quote that you like) and three slightly modified versions of that quote. You should use existing PHP functionality to modify the quote. The modifications are described below:
Explanation / Answer
first:
patterns
1 pattern:
<?php for
($row = 1; $row <= 5; $row++)
{ for ($col = 1; $col <= $row; $col++)
{
echo '$col';
}
echo " ";
}
patter 2:
<?php for
($row = 5; $row >= 1; $row--)
{ for ($col = 1; $col <= $row; $col++)
{
echo '$col';
}
echo " ";
}
patter3:
1 pattern:
<?php for
($row = 1; $row <= 5; $row++)
{ for ($col = 5; $col >= 1; $col--)
{
if($col<=$row)
echo '$col';
else
echo ' ';
}
echo ' ';
}
echo " ";
}
pattern4:
1 pattern:
<?php for
($row = 5; $row <= 1; $row-=2)
{ for ($col = 1; $col <= $row; $col++)
{
echo '$col';
}
echo " ";
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.