Question

In: Computer Science

According to researchers at Stanford Medical School (as cited in Medical Self Care), the ideal weight...

According to researchers at Stanford Medical School (as cited in Medical Self Care), the ideal weight for a woman is found by multiplying her height in inches by 3.5 and subtracting 108. The ideal weight for a man is found by multiplying his height in inches by 4 and subtracting 128. Using PHP and HTML 5, design and build a web page that calculates the ideal weight given the person’s gender and height. The user selects the gender from a drop down list and enters the height in a text box. Your PHP script should read all the input and calculate and display the ideal weight.

Solutions

Expert Solution

Answer:

Code:

<html>
<head>
<title>Weight Calculator</title>
</head>
<body>
<form method="post">
<label>Enter Your Height:</label>
<input type="number" step="0.01" id="height" name="height" required><br><br>
<label>Choose Your Gender:</label>
<select required id="gender" name="gender">
<option disabled selected>Select Gender</option>
<option>Male</option>
<option>Female</option>
</select><br><br>
<input type="submit" name="test" id="test" value="Calculate" /><br/>
</form>
<?php
function testfun()
{
if(isset($_POST["test"]))
{
$H=$_POST["height"];
$G=$_POST["gender"];
if($G=="Male")
{
$M=($H*4)-128;
}
if($G=="Female")
{
$M=($H*3.5)-108;
}
echo "<p> Your Weight is :".$M."</p>";
}

}

if(array_key_exists('test',$_POST)){
testfun();
}
  
?>
</body>
</html>

Input and Output:

DO UPVOTE ME IF IT HELPS


Related Solutions

Stanford University medical researchers conducted a study on the correlation between the use of fertility drugs...
Stanford University medical researchers conducted a study on the correlation between the use of fertility drugs and ovarian cancer. Their study, published in the American Journal of Epidemiology, concludes that the use of the fertility drugs, Pergonal and Serophene, may increase the risk of ovarian cancer by three times. The lead author of the studies, Professor Alice Whittemore, stated, "Our finding in regard to fertility drugs is by no means certain. It is based on very small numbers and is...
Stanford University medical researchers conducted a study on the correlation between the use of fertility drugs...
Stanford University medical researchers conducted a study on the correlation between the use of fertility drugs and ovarian cancer. Their study, published in the American Journal of Epidemiology, concludes that the use of the fertility drugs, Pergonal and Serophene, may increase the risk of ovarian cancer by three times. The lead author of the studies, Professor Alice Whittemore, stated, "Our finding in regard to fertility drugs is by no means certain. It is based on very small numbers and is...
Researchers believe that learning through video imitation will improve self-care skills. For 6 months the researchers...
Researchers believe that learning through video imitation will improve self-care skills. For 6 months the researchers worked with mentally impaired individuals in which half were taught self-care skills through video imitation and the other half through physical guidance. At the end of the 6 months, individuals were asked to independently perform the self-care task and were rated on the level of required assistance where a higher score indicates more assistance. What can be concluded with an α of 0.05? The...
1. (5pt) In order to study the relation of weight to blood sugar level, medical researchers...
1. (5pt) In order to study the relation of weight to blood sugar level, medical researchers considered a random sample of 12 patients. The observed Pearson correlation between weight and blood sugar level was 0.63. Perform a hypothesis test for the presence of correlation in the population at significance level 0.05. 2. (5pt) The researchers in the previous problem fit a simple linear regression model to the same data with blood sugar level as the response (Y) and weight as...
A student studying in medical school, according to the body structure of a person with high...
A student studying in medical school, according to the body structure of a person with high fever, the body will help calculate the time required to lower the temperature to a certain degree wants you to develop a formula. Heat produced in the human body 400 W, total heat passing through the body through transmission, convection and radiation If 800 W and body specific heat 3500 kJ / kgK, other students may also need other features. By choosing according to...
Balancing School and Life - My Quality of Life Self-Care Plan. The purpose of developing this...
Balancing School and Life - My Quality of Life Self-Care Plan. The purpose of developing this Plan is to set a framework and a plan to maintain wellness and to stay motivated and engaged throughout your Program. Doing this will help you achieve success during your coursework and as a professional nurse. The goal of the Project is to help you become self-aware and reflective as a means of identifying personal self-care strategies that will increase your energy and help...
According to Reader's Digest, 43% of primary care doctors think their patients receive unnecessary medical care....
According to Reader's Digest, 43% of primary care doctors think their patients receive unnecessary medical care. a. Suppose a sample of 370 primary care doctors was taken. Show the sampling distribution of the proportion of the doctors who think their patients receive unnecessary medical care. Use z-table. E(p) = ơp = (to 4 decimals) b. What is the probability that the sample proportion will be within ±0.03 of the population proportion. Round your answer to four decimals. c. What is...
According to Readers Digest, 42% or primary care doctors think their patients receive unnecessary medical care....
According to Readers Digest, 42% or primary care doctors think their patients receive unnecessary medical care. a) Suppose a sample of 300 primary care doctors was taken. Show the sampling distribution of the proportion of doctors who think their patients receive unnecessary medical care. b) What is the probability that the sample proportion will be within +/- 0.03 of the population proportion? c) What is the probability that the sample proportion will be within +/- 0.05 of the population proportion?...
According to Readers Digest, 49% of primary care doctors think their patients receive unnecessary medical care....
According to Readers Digest, 49% of primary care doctors think their patients receive unnecessary medical care. Use z-table. a. Suppose a sample of 290 primary care doctors was taken. Show the sampling distribution of the proportion of the doctors who think their patients receive unnecessary medical care. E(p)= O(p)= b. What is the probability that the sample proportion will be within (plus/minus) 0.03 of the population proportion. Round your answer to four decimals. c. what is the probability that the...
Medical researchers have noted that adolescent females are much more likely to deliver low-birth-weight babies than...
Medical researchers have noted that adolescent females are much more likely to deliver low-birth-weight babies than are adult females. Because low-birth-weight babies have a higher mortality rate, a number of studies have examined the relationship between birth weight and mother's age. One such study is described in the article "Body Size and Intelligence in 6-Year-Olds: Are Offspring of Teenage Mothers at Risk?"† The following data on maternal age (in years) and birth weight of baby (in grams) are consistent with...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT