Write a php program to calculate and display the factorial

Assignment Help PHP Web Programming
Reference no: EM131286753 , Length: 3

Question 1

a) Write a simple PHP program that dynamically populates a dropdown list on page load with values retrieved from Database db_restaurant from table tbl_dish containing two fields namely dish_ID and dish_Name. Clearly state any assumptions you make.

b) Using table Student above, write an SQL query to retrieve the student record with the lowest marks.

student_ID

first name last name

marks

001

Steve

Highway

40

002

Bill

Johnson

80

003

Denis

Neeson

90

004

Sam

Button

70

Question 2

a. The form below contains an input text box for a user to enter his name and a group of radio buttons to select his gender. Write the PHP script to print the user's name and a welcome message depending on his gender:

• For males - "Sports items on special offer"
• For females - "50% discount on handbags"

<form action="user.php" method="POST"> Name: <input type="text" name="name" /><br /> Gender:
<input type="radio" name="gender" value="male" />Male
<input type="radio" name="gender" value="female" />Female
<input type="submit" value="Submit" />
</form>

b. Consider a server with the following settings:

servername: localhost database name: monthsDB username: donald password: jerry

Create a connection string to connect to this database and explain each line of code.

C . What will be the output of the following extract codes? Describe fully how the program operates.
<?php
$states_of_the_USA = array (1 => "Alabama", "Alaska", "Arizona");
$x = array_count_values($states_of_the_USA); for ($counter=1; $counter<$x; $counter++) { echo"<BR>$states_of_the_USA[$counter]";
}
?>

D) Write a PHP program to calculate and display the factorial of any number entered into a Text Box field.

Note: You will have to use a recursive function.

E) Distinguish between the include() statement and the require() statement.

Reference no: EM131286753

Questions Cloud

Negative and positive elements of vending machine sales : What are some other opportunities for vending-machine sales? What are the negative and positive elements of vending-machine sales?
How financial management techniques or policies can be used : Using each of the four categories of risk, develop an analysis of how financial management techniques or policies can be used to mitigate each of the risks.
Calculate the force in each member of the trusses show : The walkway ABC of the footbridge is stiffened by adding the cable ADC and the short post of length L. If the tension in the cable is not to exceed 500 lb, what is the smallest value of L for which the 185-lb person can be supported at B?
Application of capacity planning in operations : Compose an analysis of that event or situation using the unit operations concept that you selected.
Write a php program to calculate and display the factorial : Write a simple PHP program that dynamically populates a dropdown list on page load with values retrieved from Database db_restaurant from table tbl_dish containing two fields namely dish_ID and dish_Name.
The store atmosphere create each stores unique image : Compare the description of the stores with the results of the survey. Attempt to explain how the different elements of the store atmosphere create each store's unique image.
How your current qualifications match up to skills needed : Explain how your current qualifications match up to the skills needed. Explain the websites you have visited and what you learned from each. Cite at least 3 search references using APA format.
Create opportunity and respond to challenges : The business environment is continuously evolving with the integration of new management trends developed to create opportunity and respond to challenges.
Calculate the force in each member of the trusses shown : Using the method of joints, calculate the force in each member of the trusses shown. State whether each member is in tension or compression.

Reviews

Write a Review

PHP Web Programming Questions & Answers

  Create a data structure containing a list of degrees

Create a data structure containing a list of degrees available (i.e. PhD, MS, MA, BS, etc) and a price for each degree.

  Qestion one describe the various ways in which a

question one describe the various ways in which a contractual relationship can come to an end including

  To create an onlinenbsp parking systemnbsp with phpmysql or

to create an onlinenbsp parking systemnbsp with phpmysql or any other coding language suitable thatallowsnbsp user real

  Calculate the total amount of a meal purchased

Design your own HTML form and corresponding PHP page to calculate the total amount of a meal purchased as a restaurant.

  1 how they are formed and give an example of this process

1. how they are formed and give an example of this process in a marketing context. further describe the factors that

  Write a php script named states.php that creates a variable

Write a PHP script named states.php that creates a variable $states with the value "Mississippi Alabama Texas Massachusetts Kansas"

  Question 1-are all laws ethical why or why not provide

question 1-are all laws ethical? why or why not? provide examples of ethical and unethical laws.support your answer

  Create a web site for an apple farm

Create a web site for an apple farm. Create an HTML5 form allowing visitors to create an account with the site. Account details are to be stored in your MySQL database. Information should be stored in a secure way.

  Question 1a what is the disparity between encryption and

question 1a what is the disparity between encryption and hashing?b why is it not always probable to use a white

  String manipulation functions by php explain the various

explain the various built in string manipulation functions supported by php and explain four scalar types of

  Personal qualities related to online dating

Write a PHP program that presents a form to a user asking them questions about their own personal qualities related to online dating

  Make a project on developing an online gift store

Make a project on developing an online gift store for gift item selling by using PHP({[P]ersonaL [H]ome [P]age} Hypertext Preprocessor). The system should be  an online application that can be accessed through the web.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd