Friday, July 31, 2009

Write a program that will read strings and process them until an empty string is input with the following?

im having a hard time with this right now. help





write a c program that utilizes strings and numeric conversions





1. Read strings using a function you write called getStr ().


2. Write a function named hextodecimal () that takes in (only) a string parameter representing a positive hexadecimal number and return its decimal equivalent (integer). This function returns -1 if the string provided connotes to a negative number and/or is comprised of invalid characters.


-note: you may not use any library functions in this function- you must write all code necessary to enact the coversion and return the appropriate result.


-this function must accept both upper and lower case versions of the hex character.


-You may want to write an additional function that vets any string for invalid hex character


3. If original string is invalid, output an unambiguous message to the user and prompt for another input.


4. Output the original String, followed by its decimal equivalent. Clearly label which is which.

Write a program that will read strings and process them until an empty string is input with the following?
You haven't said which part you are having trouble with? How you start is with your Hello World program, then add bits on according to the requirements of your program. The general idea is to teach you how to do conversions.

kudzu

No comments:

Post a Comment