Four PHPH assignemnts, A 04- A07

I don’t understand this PHP question and need help to study.

A-04: First PHP Program to Write

The Task:

Write a program that prints the numbers from 1 to 100.
But for multiples of three print the word “Alpha” instead of the number
and for the multiples of five print “Beta”.
For numbers which are multiples of both three and five print “AlphaBeta”.

Name your file “alphabeta.php“.

A-05: Sum 1 to 25 using WHILE

Copy it as well into a file “sum_1_to_25_using_while.php“.

Look up the syntax of the PHP statement WHILE on both w3schools.com and php.net.

Change the program in the sum_1_to_25_using_while.php file to use the PHP statement WHILE instead of For.

Rename the .php file appropriately for this change. Immediately after the opening “<? “, add a comment line with your name.

A-06: Sum 1 to 25 using DO-WHILE

Copy it into a new file “sum_1_to_25_using_do_while.php“.

Look up the syntax of the PHP statement DO-WHILE on both w3schools.com and php.net.

Change the program in the sum_1_to_25_using_do_while.php file to use the PHP statement DO-WHILE instead of For.

Rename the .php file appropriately for this change. Immediately after the opening “<? “, add a comment line with your name.

A-07: Sum from X to Y given by the user

Review the completed sum-from-1-to-25 in all 3 formats (For, While, Do-While).
Study the Form-and-Receiver example examined in class.

Pick one from the For, While, Do-While set and combine it with the Form-and-Receiver example to write a new program. Call the new program “sum_from_x_to_y.php“.

This program is to ask the user for two numbers (like the form input example). Given the two numbers received, the program is to SUM all the numbers from the First number to and including the Second number.
(This is the Sum 1 to 25 algorithm, except that the user is giving you the start and end numbers for the summation.)

After displaying the result, the program must give the user the option to do it again with newly-input numbers.

Get 20% discount on this paper. Use coupon: GET20

Posted in Uncategorized