0% found this document useful (0 votes)
5 views3 pages

DWAF Revision Question

The document outlines a series of revision questions across four sections: PHP, HTML, CSS, and JavaScript, covering fundamental concepts and practical applications. Each section includes specific queries about syntax, functionality, and coding practices, such as variable declaration, table elements, CSS styling, and event handling. Additionally, it presents practical tasks like creating a navigation bar, modifying content dynamically, and structuring a simple form.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

DWAF Revision Question

The document outlines a series of revision questions across four sections: PHP, HTML, CSS, and JavaScript, covering fundamental concepts and practical applications. Each section includes specific queries about syntax, functionality, and coding practices, such as variable declaration, table elements, CSS styling, and event handling. Additionally, it presents practical tasks like creating a navigation bar, modifying content dynamically, and structuring a simple form.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

DEVELOP WEBSITE APPLICATION FRONTEND

REVISION QUESTION

Section 1: PHP

1. PHP Tags: All PHP code must be enclosed within which special tags? List at least two
variations.

2. Variable Declaration: Explain how to declare a variable in PHP and assign it the string
value "Hello World". .

3. Echo Statement: In PHP, what is the purpose of the echo statement? .

4. String Concatenation: How do you concatenate two strings together in PHP? Provide
an example.

5. Conditional Statement: Write a simple PHP conditional statement that checks if a


variable $age is greater than or equal to 18. If it is, output "Adult"; otherwise, output
"Minor".

6. Include vs. Require: What is the difference between include and require in PHP?
Explain how they handle file inclusion errors.

7. Function Definition: How do you define a function in PHP? Give an example of a simple
function that adds two numbers and returns the result.

Section 2: HTML

1. Table Elements: Explain the roles of the <table>, <tr>, <th>, and <td> tags in
creating tables in HTML. Provide a simple example demonstrating their use.

2. Input Types: In HTML forms, various input element types exist. Name at least three
different input types and describe their purpose.

3. Anchor Tag: Describe the function of the <a> tag and its essential attribute (href).
Provide an example of how to create a link to an external website.

4. HTML Comments: Explain the purpose of using comments in HTML code and
demonstrate how to write a single-line and a multi-line comment.

5. Special Characters: If you want to include special characters like the copyright
symbol (©) or the less than sign (<) in your HTML, how would you do it? Provide at
least two methods.

6. Basic HTML Structure: Provide the basic structure of an HTML5 document, including
the doctype declaration, <html>, <head>, and <body> tags.

7. Meta Tag: What is the purpose of the <meta> tag in HTML? Give two examples of
how it's used, including setting the character set and providing a description for
search engines. .

8. Div vs. Span: Explain the difference between a <div> and a <span> in HTML in terms
of their usage and how they affect the layout of a web page..
Section 3: CSS

1. Embedding CSS: Describe two ways to embed CSS styles into an HTML document:
using internal stylesheets and using external stylesheets.

2. Padding vs. Margin: Explain the difference between padding and margin in CSS. Use
diagrams to illustrate your answer

3. CSS Box Model: Explain the concept of the CSS Box Model, including its components
(content, padding, border, margin) and how they affect the size and layout of an
element.

4. Button Styling: Write the CSS to style a button with the following properties: blue
background color, white text color, 10px padding, rounded corners (using border-
radius), and a hover effect that changes the background color to a darker blue.
Centering a Div: Write the CSS to center both horizontally and vertically
a <div> element with a fixed width of 300px and a height of 200px on the page.

5. Display Inline vs. Block: What is the difference between display: inline and display:
block in CSS? Explain how each affects the layout of an element and provide examples
of when you would use each.

6. Responsive Design: How do you use CSS to create a responsive design that adapts to
different screen sizes? Explain the concept of media queries and provide a simple
example.

Section 4: JavaScript

1. Equality Operators: Describe the difference between == (double equals or loose


equality) and === (triple equals or strict equality) in JavaScript. Provide examples to
illustrate the difference.

2. Including JavaScript: Describe two ways to include JavaScript in an HTML document:


using inline JavaScript within an HTML tag and using an external JavaScript file.

3. Variable Declarations: Explain the difference between var, let, and const when
declaring variables in JavaScript in terms of scope and mutability.

4. Array Access: How can you access the third element in an array named colors in
JavaScript? Provide the code snippet.

5. Variable Assignment: Write a simple JavaScript statement that declares a variable


named age and assigns it the numeric value 25.

6. JavaScript Functions: What is a JavaScript function? Explain its purpose and provide
a simple example of a function that takes two numbers as arguments and returns their
sum.
7. Event Handling: How do you handle events in JavaScript? Give an example of an event
handler that displays an alert message when a button is clicked (using either an inline
event handler or addEventListener).

Section 5: Integrated Concepts (Practical Application)

Table Data and Borders:


(a) You have the following HTML table structure:

1. <table>

2. <tr> <th>Name</th> <th>Age</th> </tr>

3. <tr> <td>John</td> <td></td> </tr>

4. <tr> <td></td> <td>25</td> </tr>

</table>

Add "Jane" and "30" to the table in the appropriate cells.


(b) Use inline CSS (the style attribute) to add a 1px solid black border to each table
cell in the table above.

5. HTML Navigation Bar: Create a basic HTML navigation bar with four links: Home,
About, Services, and Contact. Use an unordered list (<ul>) to structure the navigation
items, and ensure that each link points to a different page (even if those pages don't
exist, use placeholder URLs like #home, #about, etc.).

6. Dynamic Content and Alert:


(a) Write the JavaScript code to change the text content of a paragraph element
with the ID "myParagraph" to "The text has been changed!".

(b) Write the JavaScript code to display an alert box with the message "Button
Clicked!" when a button with the ID "myButton" is clicked. You can use either inline
event handlers or the addEventListener method.

7. Simple Form: Create a simple HTML form that asks the user for their first name and
email address. Use appropriate labels (<label>) and input fields (<input>) with the
correct type attributes. Give the form an appropriate title using a heading element.

8. Image with Caption: Write the HTML to display an image with a caption below it. Use
the <figure>, <img>, and <figcaption> elements to structure the image and caption
semantically. Provide placeholder values for the src and alt attributes of the image.

You might also like