Hi...
Write code to solve the following problem. Define a function that takes a String as a parameter and returns an integer value. The function need to loop through each character in the input string to find a value of ?x?. If a value of ?x? is found in the string then return the position within the string where ?x? is found else return -1.
_____________________
http://www.embroideryplanet.co.uk/
http://www.seo-services-seo.co.cc/
--------------------------------------------
Solution that was posted below has been removed.
Homework assistance is allowed here - doing others work is not allowed.
Senior Anandtech Moderator
Common Courtesy
I'm going to go ahead and lock this up. It's just too blatantly an attempt to get homework done, and I don't see any value in leaving it open (i.e. it's not going anywhere else good). OP, if you want help with this problem, then give it a try yourself and if you have trouble post those specific questions in another thread.
Programming Moderator
Markbnj
Write code to solve the following problem. Define a function that takes a String as a parameter and returns an integer value. The function need to loop through each character in the input string to find a value of ?x?. If a value of ?x? is found in the string then return the position within the string where ?x? is found else return -1.
_____________________
http://www.embroideryplanet.co.uk/
http://www.seo-services-seo.co.cc/
--------------------------------------------
Solution that was posted below has been removed.
Homework assistance is allowed here - doing others work is not allowed.
Senior Anandtech Moderator
Common Courtesy
I'm going to go ahead and lock this up. It's just too blatantly an attempt to get homework done, and I don't see any value in leaving it open (i.e. it's not going anywhere else good). OP, if you want help with this problem, then give it a try yourself and if you have trouble post those specific questions in another thread.
Programming Moderator
Markbnj