CS214 ASSIGNMENTs and Tutorial Questions
CS214 ASSIGNMENTs and Tutorial Questions
August 2024
1. Compare and contrast the roles of HTML, CSS, and JavaScript in building a web page. Discuss
how these languages work together to create interactive and visually appealing user
experiences. [10]
2. Describe the key components of an HTML document structure, including the <head> and
<body> sections. Explain the significance of each component and how they impact the
overall web page. [10]
3. Evaluate the importance of HTML forms in web applications. Describe the various form
elements (e.g., <input>, <textarea>, <select>) and explain how they can be used to collect
user input and data. [10]
4. Write a PHP script that declares and initializes variables for a person's name, age, and email
address. Then, use these variables to create a simple "About Me" webpage that displays the
person's information. [10]
5. Implement a PHP function that takes two numbers as input and returns their sum. Then, call
this function within a script that prompts the user to enter two numbers, calculates their
sum using the function, and displays the result. [10]
a. Design a MySQL database schema to store product information, including fields such
as product name, description, price, category, and stock quantity.
b. Write PHP code to implement the following functionalities:
c. Create a form to add a new product to the database, including form validation and
SQL queries to insert the product data.
d. Develop a page that displays a list of all products stored in the database, fetched
using SQL queries.
e. Implement a search functionality that allows users to filter the product list by name,
category, or price range, using SQL queries with WHERE clauses.
f. Add the ability to update product information (e.g., price, stock quantity) by fetching
the existing data from the database, updating the form fields, and executing SQL
queries to update the records.
g. Include a delete functionality that removes a product from the database based on
the product ID, using SQL DELETE queries.
20. With the aid of an example, explain the following SQL key words:
a. CREATE TABLE,
b. INSERT,
c. SELECT,
d. UPDATE,
e. DELETE