Need Help ?

Home >> Essays >> Other >> Database Web Interface Table of Contents TOC \o "1-3" \h \z \u How to submit PAGEREF _Toc53185514 \h 1P1 – Loop and Table (50 Points) PAGEREF _Toc53185515 \h 2P1 – Part 1 (40 points) PAGEREF

Database Web Interface Table of Contents TOC \o "1-3" \h \z \u How to submit PAGEREF _Toc53185514 \h 1P1 – Loop and Table (50 Points) PAGEREF _Toc53185515 \h 2P1 – Part 1 (40 points) PAGEREF ...



Database Web Interface
Table of Contents
TOC \o "1-3" \h \z \u How to submit PAGEREF _Toc53185514 \h 1P1 – Loop and Table (50 Points) PAGEREF _Toc53185515 \h 2P1 – Part 1 (40 points) PAGEREF _Toc53185516 \h 2P1 – Part 2 (10 points) PAGEREF _Toc53185517 \h 2P2 – Database (15 Points) PAGEREF _Toc53185518 \h 3P2-1 (7 points) PAGEREF _Toc53185519 \h 3P2-2 (4 points) PAGEREF _Toc53185520 \h 4P3-3 (4 points) PAGEREF _Toc53185521 \h 4Problem 3 – (35 Points) PAGEREF _Toc53185522 \h 4Problem 3 - Part 1 (30 Points) PAGEREF _Toc53185523 \h 4Problem 3 - Part 2 (5 Points) PAGEREF _Toc53185524 \h 5
How to submitAfter filling all the parts in this file, please follow the following steps.
Add your name and ID to the first page.
Save the file in the original format (Docx or Doc)
(please do not convert to other file formats e.g. PDF, ZIP, RAR, …).
Rename the file as
YOUR First Name– YOUR Last Name–ID.docx
Example: John-Smith-234566435.docx
Upload and submit your file (only via Blackboard).
P1 – Loop and Table (50 Points)P1 – Part 1 (40 points)Run a loop for 7 iterations starting from 1 and ending at 7 (step size: 1) and print 2n (2 to the power of n) in the following table format.
n 2n
1 2
2 4
3 8
4 16
5 32
6 64
7 128
Hint: We solved this problem in the class for printing 2*n. Just modify a line in that code to print 2^n and that is it. You can use pow(a,b) function or a**b operator to calculate ab.
Your PHP Code
-- Copy and paste your PHP code here
<table>
<tr>
<th>
n
<th/>
<th>
2^n
<th/>
<tr/>
<?php
for ($i = 1; $i <= 7; $i++) {
$res = pow(2, $i);
echo "<tr><td>{$i}<td/><td>{$res}<td/><tr/>";
}
?>
<table/>
Run the code and insert the result in the following box.
The run result
Copy and paste the result here (e.g. the screen shot of the result you get by running the code)

P1 – Part 2 (10 points)Modify the code in previous section to print factorial(n) in the table format.
n factorial(n)
1 1
2 2
3 6
4 24
5 120
6 720
7 5040
Your PHP Code
-- Copy and paste your PHP code here
<table>
<tr>
<th>
n
<th/>
<th>
n!
<th/>
<tr/>
<?php
function Factorial($number){
$factorial = 1;
for ($i = 1; $i <= $number; $i++){
$factorial = $factorial * $i;
}
return $factorial;
}

for ($i = 1; $i <= 7; $i++) {
$res = Factorial($i);echo "<tr><td>{$i}<td/><td>{$res}<td/><tr/>";
}
?>
<table/>
Run the code and insert the result in the following box.
The run result
Copy and paste the result here (e.g. the screen shot of the result you get by running the code)

P2 – Database (15 Points)8953529337000Create the following relational database using SQL commands and answer questions 1 to 3.
251841084074000259969083439000260223083248500453453582105500453326581978500395795582550000
278511030505400

This is a preview of the full document

Get Full Access
Get Help With Your Essay
Document Details
Word Count: 1669
Page Count: 14
Level:AS and A Level
Subject:Other
WhatsApp