Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This App uses Al for monitoring persons dietary plan. This IOS application acts

ID: 3599940 • Letter: T

Question

This App uses Al for monitoring persons dietary plan. This IOS application acts like a dietician and enables the user to consult for diet based on the body information mentioned. This app will allow the user to: 1. Register by providing the body type, height, weight, and working hour detail. 2. Generate diet plan using some basic information of the diet. The app may also ask the user if they accept the diet plan. If the plan is not as per the user convenience, the app may also give a alternate diet plan to the user. 3. Generate results based on the data entered by the user. The results processing depends on the metrics which is already known to the application. **Assume that a Rational Unified Process model is being used.

Explanation / Answer

reg.html

This file is used to enter the details of the users.

<html>
<head>
<title>Personal INFO</title>
</head>
<body align="center" bgcolor="green">
<h1 align="center"> DIET PLAN</h1>
<form method="post" action="registration.php">
Name:<input type="text" size="12" maxlength="20" name="name"><br/>
Gender:
Male:<input type="radio" value="Male" name="gender">
Female:<input type="radio" value="Female" name="gender"><br/>
Select your Body Type:<br/>
<select name="bodytype">
<option value="Ectomorph">Ectomorph: Lean and long, with difficulty building muscle. </option>
<option value="Endomorph">Endomorph: Big, high body fat, often pear-shaped, with a high tendency to store body fat.</option>
<option value="Mesomorph">Mesomorph: Muscular and well-built, with a high metabolism and responsive muscle cells.</option>
</select><br/>

Height:<input type="text" size="12" maxlength="20" name="ht"><br/>
Weight:<input type="text" size="12" maxlength="20" name="wt"><br/>
<input type="submit" value="Submit!" name="submit">
</form>
</html>

dbconnect.php

If you want to save the details of the user to the database use the following code to connect to database. Use wamp or xampp server to execute the code. Create the database as diet with username root and with no password.

<?php
$conn = new mysqli("localhost","root","","diet");
// Check connection
if ($conn->connect_error)
{
die("Connection failed: " . $conn->connect_error);
}
?>

registration.php

Am not storing the details in the database so i have commented on the include line and insert statements. A sample diet plan is made with 3 body types and given to the customers on their basic body structure.

<?php //start php tag

//include connect.php page for database connection

//include('dbconnect.php');

$a=$_REQUEST["name"];

$b=$_REQUEST["gender"];

$c=$_REQUEST["bodytype"];

$d=$_REQUEST["ht"];

$e=$_REQUEST["wt"];

//$sql1="insert into reg(name,gender,bodytype, height, weight) values('$a','$b','$c','$d','$e')";

//$res=$conn->query($sql1);

if($c== 'Ectomorph')

{

echo "<html><body> <h1>Your diet as per your body type:</h1>

<ul>

<li>Oatmeal with Fresh or Frozen (No Sugar Added) Fruit</li>

<li>Tea or Coffee</li>

<li>Veggie-Salsa Tortilla</li>

<li>1 Navel Orange or 2 Tangerines</li>

<li>2 Cups Mixed Greens with 1 Cup of Other Veggies, Chopped, Dressed with Aged Balsamic Vinegar</li>

<li>Hearty Italian-Style White Bean Soup</li>

<li>6 Ounces of Nonfat Plain or No-Sugar-Added Yogurt with Your Choice of Berries Swirled Throughout</li>

<li>1 Apple</li>

<li>Salad</li>

<li>Mustard Coated Salmon (3½ to 4 ounces)</li>

<li>Baked Potato with 2 Tablespoons Fat-Free Sour Cream and a Sprinkling of Chives or Scallions</li>

<li>Mixed Berries</li>

</ul></body></html>";

}

if($c== 'Endomorph')

{

echo "<html><body> <h1>Your diet as per your body type:</h1>

<p>Vegetarian diets are an excellent way to lose weight. That’s because, veggies contain good carbs, dietary fiber, vitamins,

minerals, healthy fats, and proteins. These nutrients prevent absorption of fat, improves bowel movement, strengthens bones,

helps shed fat and build muscle mass, boosts brain function, energize the body, and keep all the diseases away.

Although most Indians follow a vegetarian diet, they are still obese or suffer from various diseases.

So, first things first, here’s a list of foods that you must avoid.

<br/>

Foods To Avoid In Indian Vegetarian Diet</p>

<ul>

<li>Carbonated beverages</li>

<li>Packaged fruit or vegetable juices</li>

<li>Lard, dalda, butter, vegetable oil</li>

<li>Namkeen, bhujia (homemade or not)</li>

<li>Sweets, milk chocolate</li>

<li>Too many chapatis, and too much rice</li>

<li>Consume paneer in moderation</li>

</ul>

</body></html>";

}

if($c== 'Mesomorph')

{

echo "<html><body> <h1>Your diet as per your body type:</h1>

<p>Paleo diet is also a great option when it comes to heavy muscular body. The theory behind Paleo diet is 'eat like a caveman to shed pounds'.

The high-protein and high-fiber diet allow you to maintain your physique without cutting on calories.

Paleo or Stone Age Diet also helps to keep diabetes, coronary disease, and cancer at bay.

You must have lean meat, fish, fruits, vegetables, and healthy fats. You can also include legumes, nuts, seeds, and peanuts.

<br>

Foods To Avoid</p>

<ul>

<li>All processed foods</li>

<li>Refined oils like canola</li>

<li>Refined sugar</li>

<li>Potatoes</li>

<li>Dairy</li>

<li>Salt</li>

</ul></body></html>";

}

?>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote