Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

HELLO need help with only php part i dont need html or css for this.. I also submitted my work but i relised that i

HELLO need help with only php part i dont need html or css for this.. I also submitted my work but i relised that i did wrong instead of for example while loop. I did for loop so please help to change everything like in the description the last screenshot is mine work shows that i did everything opposite please help me to fix it thank you.

example.

mine is for loop it needs to be in while loop

for ($i = 1; $i

print("(XY)"); }

echo " "; } echo " ";

image text in transcribed

image text in transcribed

image text in transcribed

Save the files in subfolder lastname_firstname_assignment2\q31. (1 point) Create web page(s) that displays the default information (example shown). The initial page and related outputs should look like the examples shown below. (3 points) Create your page(s) using "'s Kung Fu Panda Po Magic Rectangle as the page title(s) ( tag). (2 points) Save the first page as index.htm (or index.php). Use a HTML form to capture user input. Submit the form to a second file index_process.php using the POST method. (3 points) The second page contains a link to go back to the first page. (2 points for link) Write a program that asks the user for Pos row and column numbers for generating magic rectangles. o Capture row and column numbers. (1 point) o Generate the magic rectangles shown using nested loops (two-dimensional loops). The first rectangle must be generated by nested while loops. (4 points) while (...) { while (...) () } The second rectangle must be generated by nested do...while loops. (4 points) do { do {} while (...) } The third rectangle and related calculation must be generated by nested for loops. (4 points) for (...) { for (...) () } Create a css file named style.css to format all pages by creating your own layout (no two students should have the same layout). You can use the same (or similar) css file(s) to format all questions. (3 points) O Example: Test case 1 input http://localhost/my_php/ricardo_richard_assignment2/43/ Search Richard Ricardo's Kung Fu Panda Po Magic Rectangle Enter Po's row and column numbers. Po's row: Po's column: generate Po's magic rectangle Po's Magic Rectangle: Example: Test case 1 output http://localhost/my.php/ricardo_richard_assignment2/43/index_process.php?rowa3 C Search Richard Ricardo's Kung Fu Panda Po Magic Rectangle Po's Magic Rectangle: Po's magic rectangle has 3 rows, and 4 columns. Nested while loop rectangle (XY)(XY)(XY)(XY) (XY)(XY)(XY)(XY) (XY)(XY)(XY)(XY) Nested do..while loop rectangle loc(r1,c1); loc(r1,c2); loc(r1,c3); loc(r1,c4); loc(r2,ci); loc(r2,c2); loc(r2,c3); loc(r2,c4); loc(r3,ci); loc(r3,c2); loc(r3,c3); loc(r3,04); Nested for loop rectangle 1+1=2; 1+2=3; 1+3=4; 1+4=5; 2+1=3; 2+2=4; 2+3=5; 2+4=6; 3+1=4; 3+2=5; 3+3=6; 3+4=7; back to first page <?php echo "Nested For Loop Rectangle"; echo " "; for ($i = 1; $i <= $row; $i++) { for ($j = 1; $j <= $col; $j ++) { print("(XY)"); } echo " "; } echo " "; echo "Nested do.. While Loop Rectangle"; echo " "; $i = 1; while ($i <= $row) { $j = 1; while ($j <= $col) { echo "loc, row" . $i . "Col" . $j. "; "; $j++; } echo " "; $i++; } echo " "; echo "Nested Do while Loop Rectangle"; echo " "; $i = 1; do { $i * $j."; "; $j = 1; do { echo $i . "x" . $j. "" $j++; } while ($j <= $col); echo " "; $i++; } while ($i <= $row); ?> Save the files in subfolder lastname_firstname_assignment2\q31. (1 point) Create web page(s) that displays the default information (example shown). The initial page and related outputs should look like the examples shown below. (3 points) Create your page(s) using "<your name>'s Kung Fu Panda Po Magic Rectangle as the page title(s) (<title> tag). (2 points) Save the first page as index.htm (or index.php). Use a HTML form to capture user input. Submit the form to a second file index_process.php using the POST method. (3 points) The second page contains a link to go back to the first page. (2 points for link) Write a program that asks the user for Pos row and column numbers for generating magic rectangles. o Capture row and column numbers. (1 point) o Generate the magic rectangles shown using nested loops (two-dimensional loops). The first rectangle must be generated by nested while loops. (4 points) while (...) { while (...) () } The second rectangle must be generated by nested do...while loops. (4 points) do { do {} while (...) } The third rectangle and related calculation must be generated by nested for loops. (4 points) for (...) { for (...) () } Create a css file named style.css to format all pages by creating your own layout (no two students should have the same layout). You can use the same (or similar) css file(s) to format all questions. (3 points) O Example: Test case 1 input http://localhost/my_php/ricardo_richard_assignment2/43/ Search Richard Ricardo's Kung Fu Panda Po Magic Rectangle Enter Po's row and column numbers. Po's row: Po's column: generate Po's magic rectangle Po's Magic Rectangle: Example: Test case 1 output http://localhost/my.php/ricardo_richard_assignment2/43/index_process.php?rowa3 C Search Richard Ricardo's Kung Fu Panda Po Magic Rectangle Po's Magic Rectangle: Po's magic rectangle has 3 rows, and 4 columns. Nested while loop rectangle (XY)(XY)(XY)(XY) (XY)(XY)(XY)(XY) (XY)(XY)(XY)(XY) Nested do..while loop rectangle loc(r1,c1); loc(r1,c2); loc(r1,c3); loc(r1,c4); loc(r2,ci); loc(r2,c2); loc(r2,c3); loc(r2,c4); loc(r3,ci); loc(r3,c2); loc(r3,c3); loc(r3,04); Nested for loop rectangle 1+1=2; 1+2=3; 1+3=4; 1+4=5; 2+1=3; 2+2=4; 2+3=5; 2+4=6; 3+1=4; 3+2=5; 3+3=6; 3+4=7; back to first page <?php echo "Nested For Loop Rectangle"; echo " "; for ($i = 1; $i <= $row; $i++) { for ($j = 1; $j <= $col; $j ++) { print("(XY)"); } echo " "; } echo " "; echo "Nested do.. While Loop Rectangle"; echo " "; $i = 1; while ($i <= $row) { $j = 1; while ($j <= $col) { echo "loc, row" . $i . "Col" . $j. "; "; $j++; } echo " "; $i++; } echo " "; echo "Nested Do while Loop Rectangle"; echo " "; $i = 1; do { $i * $j."; "; $j = 1; do { echo $i . "x" . $j. "" $j++; } while ($j <= $col); echo " "; $i++; } while ($i <= $row); ?>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions