KevinG Posted May 25, 2007 Share Posted May 25, 2007 Hello, im new to php and trying to learn. I have tried lots of stuff. I have got 2 questions. Write and test PHP code to calculate the cost of carpet in a room 5.5 metres x 4.0 metres and the cost of carpet at $90 per square metre. Format correctly using the printf function. Write and test PHP code that will convert letter "X" to ASCII and convert the ASCII value 88 to the letter it represents. Can someone please tell me the code for these 2 little questions ? Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/52916-i-have-got-a-question/ Share on other sites More sharing options...
pocobueno1388 Posted May 25, 2007 Share Posted May 25, 2007 Why are you trying to take on things you aren't ready for? You need to read on how to do the basics that will lead you up to being able to do those problems. There is no point in asking for the answer for everything you can't do...you will never learn that way. So my advice to you would be to find some beginner tutorials and start reading/practicing. Quote Link to comment https://forums.phpfreaks.com/topic/52916-i-have-got-a-question/#findComment-261327 Share on other sites More sharing options...
KevinG Posted May 25, 2007 Author Share Posted May 25, 2007 lol no, this is also im learning at school and this is one the question too. So, I just wanted to know the codes and it will make it easier for me. Please tell me. Thanx Quote Link to comment https://forums.phpfreaks.com/topic/52916-i-have-got-a-question/#findComment-261330 Share on other sites More sharing options...
AndyB Posted May 25, 2007 Share Posted May 25, 2007 $cost = 5.5 * 4.0 * 90; Now read the manual on sprintf() to find out how to format. Then read the manual functions ord() and chr() http://ca.php.net/manual/en/function.chr.php - there one for you. The other two are for you to discover. Quote Link to comment https://forums.phpfreaks.com/topic/52916-i-have-got-a-question/#findComment-261481 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.