April 2016
Beginner
550 pages
9h 40m
English
<?php with no space between the <? and php.I'm fine contains a ', it should be surrounded by double quotes ("I'm fine") or the ' should be escaped ('I\'m fine').?>, not ??>. Or, if this code were the last thing in its file, the closing PHP tag could be omitted.$hamburger=4.95;$shake=1.95;$cola=0.85;$tip_rate=0.16;$tax_rate=0.075;$food=(2*$hamburger)+$shake+$cola;$tip=$food*$tip_rate;$tax=$food*$tax_rate;$total=$food+$tip+$tax;'The total cost of the meal is $'.$total;
$hamburger=4.95;$shake=1.95;$cola=0.85;$tip_rate=0.16;$tax_rate=0.075;$food=(2*$hamburger)+$shake+$cola;$tip=$food*$tip_rate;$tax=$food*$tax_rate;$total=$food+$tip+$tax;printf("%d %-9s at\$%.2f each:\$%5.2f\n",2,'Hamburger',$hamburger,2*$hamburger);printf("%d %-9s at\$%.2f each:\$%5.2f\n",1,'Shake',$shake,$hamburger);printf("%d %-9s at\$%.2f each:\$%5.2f\n",1,'Cola',$cola,$cola);printf("%25s:\$%5.2f\n",'Food Total',$food);printf("%25s:\$%5.2f\n",'Food and Tax Total',$food+$tax);printf("%25s:\$%5.2f\n",'Food, Tax, and Tip Total',$total);
$first_name='Srinivasa';$last_name='Ramanujan';$name="$first_name$last_name";$name;strlen($name);
$n=1;$p=2;"$n,$p\n";$n