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

  Random integral numbers based on normal distribution

Prepare a system to generate random integral numbers based on normal distribution. Study Data Generator's structure and extend number generation type to activate normal distribution.

  Shopping cart program for web applications class

Shopping Cart program for web applications class. Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for all items.

  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.

  Develop a dynamic website open university

Develop a dynamic website Open University

  Sample website project

This website consists of three sections: a narrative, a storyboard, and a business Website.

  Online banking application

Designing and developing a web applications The company you are working has secured a contract with a local banking group to develop an ONLINE BANKING APPLICATION using PHP and MySQL.

  Design a dynamic database

Design a dynamic database using Mangodb, html , and php.

  Show the accessibility and usability of website

The webpage must have several menus about country Azerbaijan such as "About Azerbaijan" "History" "Geography" "Landscape" and "Accessibility" menu.

  Implement a web application

Implement a web application called CS320Starter, which is similar to the crowd funding platform Kickstarter where people raise funds for their projects.

  Prepare an ajax enabled web form

Prepare an AJAX enabled web form utilising a ListView control that will allow logged-in staff to list, edit, delete, insert magazine details for magazines from a selected magazine category.

  Create a very simple order system as a web application

Create a very simple Order System as a web application.

  Which of the following jsp expressions is valid

A JSP expression can contain any Java expression that evaluates to a String object, Java object, primitive type, primitive type or Java object

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