Jump to content

php newbie, need your help guys!


raj___

Recommended Posts

Hey everybody, new to this so forgive me if i'm posting in the wrong section. i'm new to the whole php scene and was wondering if you guys could help me!?

 

Below is an excerpt of my code:

 

 

<?php (in bold)

/* This program

 

 

*/

 

$username = 'bob'                                      //

$weight_lbs = 140;

 

print 'convert your weight';                        //

 

$weight_kgs = ($weight_lbs / 2.2 ;

 

 

print 'bob your weight in kilograms is 60kgs';

>

 

 

Ok so i have to answer these questions and I am totally confused

 

a) Find and correct the 3 errors in the code

b  Add comments to the program using both single and multiline comments

c) Modify the final print statement to use the variables to print the values bob and the calculated weight in kilograms

d) Modify the program so that the final print statement is executed only if the value stored in $weight_lbs is more than 120

e) Re-write this program using a loop structure to add 2lbs onto the users initial weight given in lbs while the weight remains less than 180lbs

 

 

My final print statement should read:

 

Print "to reach your max weight of 180lbs you can increase your weight by 2lbs a day for $counter days";

 

 

 

Ok so i will greatly appreciate any help from anybody who is offering. Thanks in advance guys!

 

Link to comment
https://forums.phpfreaks.com/topic/113898-php-newbie-need-your-help-guys/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.