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

  Examine the arguments for and against this approach

Some Web sites state that their pages are best viewed in a particular browser or browser version or that they do not support certain browser versions. Examine the arguments for and against this approach.

  Question 1 what type or types of business entityies do you

question 1. what type or types of business entityies do you recommend able baker charlie and delta create?question 2.

  Pastico corporation hears through the grapevine that its

pastico corporation hears through the grapevine that its employees are unhappy with the working conditions and wages

  Produce a description of the modules

Provide a brief description within comment tags at the bottom of your HTML5 file of some of the ways you have separated content and presentation in your assignment.

  Q1-joe and george are good friendsjoe is a builder and

q1-joe and george are good friends.joe is a builder and george is in underwear. george wants a house built so after a

  Create a simple survey

Create a simple survey form that posts to a PHP script and then saves the form inputs to a file. The program should then respond with a display of the information contained in the file including the latest post

  Create a table in your database server

Write a PHP script to create a table in your database server to hold your user data - Create a nicely formatted (based on formatting topics we've covered so far) web page with a form to collect user data

  Purpose of the attach php code searches a mysql database

It works very well, just that it displays all the search results all in one screenful. If it found 100 records then that's how many records it displays to the screen at a time.

  Why do we create a web site plan

Why do we create a web site plan?2. What are the several types of objectives?

  Write a program to find the gross salary of given employee

Write a program to Find the gross salary of given employee.

  Develop an envisioned methodology and design a research

develop an envisioned methodology and design a research topic based on the research problem purpose. then write a

  Functions and code to test array of strings in php

Write, test and debug PHP scripts for specifications which follow. Write functions and code to test them. Parameter: An array of strings.

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