home / study / questions and answers / engineering / computer science / create y
ID: 3760778 • Letter: H
Question
home / study / questions and answers / engineering / computer science / create your own web page that uses both html and ...
Question
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.
***1. 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
Perimeter = XX meters
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.
***2. 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:
Modification
Description
Original
Original quote as is
Replace “we” with “me”
Replace all occurrences of we with me (Note: you can choose a string of your choice instead of using we and me.)
The location of all letters that are equal to ‘t’
Find and display the location of all t’s in your string quote.
All Upper Case
Display all characters in upper case.
The following is a reasonable representation of the second table:
Original
You know, when we fought the Cylons, we did it to save ourselves from extinction. But we never answered the question 'Why?' Why are we as a people worth saving? We still commit murder because of greed and spite, jealousy, and we still visit all of our sins upon our children. We refuse to accept the responsibility for anything that we've done, like we did with the Cylons. We decided to play God, create life. And when that life turned against us, we comforted ourselves in the knowledge that it really wasn't our fault, not really. You cannot play God then wash your hands of the things that you've created. Sooner or later, the day comes when you can't hide from the things that you've done anymore.
Replace we with me
You know, when me fought the Cylons, me did it to save ourselves from extinction. But me never ansmered the question 'Why?' Why are me as a people worth saving? We still commit murder because of greed and spite, jealousy, and me still visit all of our sins upon our children. We refuse to accept the responsibility for anything that me've done, like me did with the Cylons. We decided to play God, create life. And when that life turned against us, me comforted ourselves in the knowledge that it really wasn't our fault, not really. You cannot play God then wash your hands of the things that you've created. Sooner or later, the day comes when you can't hide from the things that you've done anymore.
Location of t’s
The letter 't' was found at position: 23
The letter 't' was found at position: 25
The letter 't' was found at position: 45
The letter 't' was found at position: 47
The letter 't' was found at position: 72
The letter 't' was found at position: 76
The letter 't' was found at position: 84
The letter 't' was found at position: 104
The letter 't' was found at position: 112
The letter 't' was found at position: 150
The letter 't' was found at position: 165
The letter 't' was found at position: 175
The letter 't' was found at position: 208 …
All Upper Case
YOU KNOW, WHEN WE FOUGHT THE CYLONS,
WE DID IT TO SAVE OURSELVES FROM
EXTINCTION. BUT WE NEVER ANSWERED THE
QUESTION 'WHY?' WHY ARE WE AS A PEOPLE
WORTH SAVING? WE STILL COMMIT MURDER
BECAUSE OF GREED AND SPITE, JEALOUSY, AND
WE STILL VISIT ALL OF OUR SINS UPON OUR
CHILDREN. WE REFUSE TO ACCEPT THE
RESPONSIBILITY FOR ANYTHING THAT WE'VE
DONE, LIKE WE DID WITH THE CYLONS. WE
DECIDED TO PLAY GOD, CREATE LIFE. AND WHEN
THAT LIFE TURNED AGAINST US, WE COMFORTED
OURSELVES IN THE KNOWLEDGE THAT IT REALLY
WASN'T OUR FAULT, NOT REALLY. YOU CANNOT
PLAY GOD THEN WASH YOUR HANDS OF THE
THINGS THAT YOU'VE CREATED. SOONER OR
LATER, THE DAY COMES WHEN YOU CAN'T HIDE FROM THE THINGS THAT YOU'VE DONE ANYMORE.
Note: the … in the Location of t’s cells is present only to demonstrate there are more t’s in the quote. In your example, you should list all positions.
***3.For the third and final table, you need to use PHP loops to display the following 4 patterns in each of the table cells:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7
1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
1
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
6 5 4 3 2 1
7 6 5 4 3 2 1
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7
1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Feel free to add additional HTML and PHP elements to enhance your web application. Create screen shots showing the successful running of your application.
Hide comments
Comments
Expert Answer
Hang tight! We are finding a Chegg Expert to answer this question.
Computer Science tutors who can help right now
Mandi S.
University of Texas at Dallas
7
Kiran P.
B.I.T.S. Pilani,
89
Varnika G.
Indian Institute of Technology, Roorkee
25
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
Explanation / Answer
caliculating the areas and circumference
<html>
<head>
<meta charset="utf-8">
<title>Table Demo</title>
<style>
table, th, td{
border: 1px solid #333;
}
</style>
</head>
<body>
$cir1=2*($l++$b);
$b=10.2;
$h=5.4
$area2=0.5*$b*$h;
$m=sqrt(pow($b,2),pow($h,2));
$cir2=$m+$h+$b;
$ba=5.3;
$area3=pow($ba,2);
$cir3=4*$ba;
?>
echo'
<table>
<tr>
<th>circle</th>
<th>triange</th>
<th>Right triangle</th>
<th>square</th>
</tr>
<tr>
<td>$cir</td>
<td>$area</td>
</tr>
<tr>
<td>$cir1</td>
<td>$area1</td>
</tr>
<tr>
<td>$cir2</td>
<td>$area2</td>
</tr>
<tr>
<td>$cir3</td>
<td>$area3</td>
</tr>
</table>'
</body>
</html>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.