ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can you give us any context to go with this? I have no idea what that "number" is supposed to be. What does "school nr." mean? Is this supposed to be a course reference number or something?
You first need to understand the problem. Forget the computer, how would you do this by hand?
One guess is that you are being asked to extract the number from the text, so the final result would be 952708. That however is just a guess because I don't know what you need to do and you haven't explained the problem well enough for me to provide you with any more assistance.
You first need to understand the problem. Forget the computer, how would you do this by hand?
Bingo. There are usually many ways to solve a problem programmatically. But none of those present themselves until you understand how it's done conceptually (the "business logic", if you will).
And please stop abbreviating number (?) as nr. It's just confusing. We are humans, not compilers.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
well since it has a P in it it couldn't POSSIBLY be hex since hex only goes to F (decimal equivalent, 15), the question though is what kind of decimal value are you talking about? ascii values?
that question seems horribly ambiguous, since there is no information provided as to what KIND of number it is in the first place, you can't convert on unknown into something else with any certainty ya know.
well since it has a P in it it couldn't POSSIBLY be hex since hex only goes to F (decimal equivalent, 15), the question though is what kind of decimal value are you talking about? ascii values?
that question seems horribly ambiguous, since there is no information provided as to what KIND of number it is in the first place, you can't convert on unknown into something else with any certainty ya know.
There can be a radix 36 system - 10 digits + 26 English alphabet letters.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.