Hi..
I'm wondering how could we make a program that could determine one's age by just entering his or her identification card number..
Is there any function in c++ that we can use??
this is the sample of question...

Movies in cinema has ratings to suit ones appropriate age level and mentality. To reserve a cinema ticket online, users are required to enter their IC number to verify their age. If the patron’s is aged 21 and above, they are in the ‘adult’ category. Patrons between the age of 20 and 13 are ‘teenagers’. If the patron is aged below 12, they are in the ‘child’ category. Patron’s who are above the age of 59 are in the category of ‘senior citizen’.

Recommended Answers

All 6 Replies

Well firstly you will need a database or a particular condition to determine the age of the person with the ID card number.

If this is a project for you ..... read through the material to get the basic condition. And then you can interpret it in the code :)

Happy Coding.

could you tell me what do i suppose to read??
thank you...

Well firstly you will need a database or a particular condition to determine the age of the person with the ID card number.

If this is a project for you ..... read through the material to get the basic condition. And then you can interpret it in the code :)

Happy Coding.

didn't your instructor tell you where that IC number comes from? AFAIK there is no online database of IC numbers.

Actually this is not a project that i suppose to do..
I just accidentally found this question..
So I'm wondering how should i do this kind of program...
could anyone helps me?
because i really curious about this, plus i'm still new
so there are a lot of things that i dont know yet...
Please help me...thanks...:)


didn't your instructor tell you where that IC number comes from? AFAIK there is no online database of IC numbers.

In that case you will probably have to create your own database if IC numbers and related ages. Just use a standard text editor to create it, something like this where the first column is an IC number and the second column is an age.

100   25
101   15
102   32
etc. etc

Then when the program asks for IC number, open the above file and read it until the program finds the right row.

Check few IC numbers carefully , may be it includes year of birth ,etc .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.