100% found this document useful (1 vote)
330 views

SA1 - Variable, Operators and Control Structures

Applications Development and Emerging Technologies - TECHNICAL-SUMMATIVE ASSESSMENT 1 - PHP OUTPUT, VARIABLE FAMILIARIZATION, OPERATORS AND CONTROL STRUCTURE

Uploaded by

Micah Mackenzie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
330 views

SA1 - Variable, Operators and Control Structures

Applications Development and Emerging Technologies - TECHNICAL-SUMMATIVE ASSESSMENT 1 - PHP OUTPUT, VARIABLE FAMILIARIZATION, OPERATORS AND CONTROL STRUCTURE

Uploaded by

Micah Mackenzie
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

DEPARTMENT OF COMPUTER STUDIES

(Applications Development and Emerging


Technologies)

TECHNICAL-SUMMATIVE ASSESSMENT

1
PHP OUTPUT, VARIABLE FAMILIARIZATION, OPERATORS
AND CONTROL STRUCTURE

Student Name / Group Micah Mackenzie P. Lozano


Name:
Name Role
Members (if Group):

Section:
Professor:
LABORATORY ACTIVITY

1. The student will create a student registration form using HTML and CSS with the
integration of PHP Scripts please refer to the attached image for the example.
2. All user entries from the student registration form will be converted in variables
3. In the output, they need to call for the declared variables and do some string formats like
name cases and numbers.

Output:

Screenshot:
4. Create a php program that will display the same output below. Use control structures to
display the multiplication table with alternating color.
Output:
Screenshot:
5. Using PHP scripts create / simulate a fibonnaci sequence.

Output:

Screenshot:
6. Using PHP scripts create / simulate a factorial

n! = n·(n – 1)·(n – 2) · · · 3·2·1

Output:

Screenshot:
QUESTION AND ANSWER

1. What is a variable?
- A name of memory location that holds data

2. What are the rules in creating a variable?


- A variable starts with the $ sign, followed by the name of the variable.
- A variable name must start with a letter or the underscore character.
- A variable name cannot start with a number.
- A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
3. Is it important to know HTML and CSS before using PHP? Explain
- Yes, it is highly recommended to start with HTML and then move on to PHP, so it would make more
sense for you to get the whole idea behind programming and building webpages.
4. What is the difference between operator precedence and operator associativity?
- Operator precedence determines which operator is performed first in an expression with more than one
operator with different precedence. Operators Associativity is used when two operators of same
precedence appear in an expression. Associativity can be either Left to Right or Right to Left.
5. What are the different control structures? Explain each
- The three basic types of control structures are sequential, selection and iteration. They can be
combined in any way to solve a specified problem. Sequential is the default control structure,
statements are executed line by line in the order in which they appear.
6. Explain the rules of break, continue, and go to statements.
- Break - ends execution of the current structure. Break accepts an optional numeric argument which tells
it how many executions of nested structures to be interrupted.
- Continue - is used to stop processing the current block of code in the loop and goes to the next
iteration.
- goto - which is the operator of unconditional transition. It used to go into another area of the code.

You might also like