<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS406 Assignment 2 Solution and Discussion]]></title><description><![CDATA[<p dir="auto">Assignment No.  02<br />
Fall 2019<br />
CS406 – Web Based Database Applications	Total Marks: 20</p>
<p dir="auto">Due Date: 05-Dec-2019</p>
<p dir="auto">Assignment Submission Instructions:<br />
Please read the following instructions carefully before submitting assignment:<br />
It should be clear that your assignment will not get any credit if:</p>
<p dir="auto">o	Assignment is submitted after due date.<br />
o	Submitted assignment does not open or file is corrupt.<br />
o	Assignment is copied (From internet/ to from students).<br />
o	You must submit assignment only in .php format, and you must keep all your files in a single folder and zip the folder to upload .zip or .rar file on LMS.</p>
<p dir="auto">Lectures Covered:</p>
<p dir="auto">Week 4, Week 5 and Week 6 Lectures have been covered.</p>
<p dir="auto">Objectives:</p>
<p dir="auto">The purpose of this assignment is to make you familiar with following topics:</p>
<p dir="auto">•	PHP Syntax, Data Types, Variables and Variables scope</p>
<p dir="auto">•	PHP Functions and Controls, Functions, Control Structures, Loops, Arrays</p>
<p dir="auto">•	Embedded PHP, Embedded PHP in HTML 5, Strings in PHP</p>
<p dir="auto">Assignment 	Marks: 12+8<br />
Question 1:</p>
<p dir="auto">Write a program in PHP using for loop and embed it in HTML.</p>
<ol>
<li>The title “Assignment No 2” should be on the top of the page.</li>
<li>The border size of the table should be 1.</li>
<li>There should be 3 Columns and 10 Rows.</li>
<li>Create 2 arrays, one for Order Quantity and One for Unit price and then multiply Order quantity with Unit price and show it result in 3rd column.</li>
<li>You will use a single loop to print the values of arrays and the result.</li>
</ol>
<p dir="auto">Hint: You can also embed html tags in PHP code.</p>
<p dir="auto">Sample Out Put:<br />
<img src="https://i.imgur.com/2d4OLtq.png" alt="8d912334-2a82-4525-8025-1c32099f2827-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Question 2:</p>
<p dir="auto">Write a function (totalWords) in PHP which will receive two strings. After receiving the strings it will find total words in each string individually using built-in function str_word_count() and then it will return the total words of both the strings and then print the total words on the screen.</p>
<p dir="auto">For example :</p>
<pre><code>String 1= “Virtual University of Pakistan”
String 2= “Federal Government University”
</code></pre>
<p dir="auto">Total Words = 7</p>
<p dir="auto">Deadline: Your assignment must be uploaded on or before the given due date. We shall not accept your solution through email after the due date.</p>
]]></description><link>https://community.secnto.com//topic/756/cs406-assignment-2-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 21:47:55 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/756.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 05 Dec 2019 10:44:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS406 Assignment 2 Solution and Discussion on Thu, 05 Dec 2019 10:49:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/zareen" aria-label="Profile: zareen">@<bdi>zareen</bdi></a> said in <a href="/post/2218">CS406 Assignment 2 Solution and Discussion</a>:</p>
<blockquote>
<p dir="auto">Write a program in PHP using for loop and embed it in HTML.</p>
</blockquote>
<p dir="auto"><a href="https://www.youtube.com/watch?v=Zhy7UHUwBKE" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.youtube.com/watch?v=Zhy7UHUwBKE</a></p>
]]></description><link>https://community.secnto.com//post/2219</link><guid isPermaLink="true">https://community.secnto.com//post/2219</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Thu, 05 Dec 2019 10:49:05 GMT</pubDate></item></channel></rss>