mardi 27 décembre 2016

How to display a user entered array to a file

So, here is a question my prof gave me for a homework but I cant seem to find a way to start doing it. Any tips on how?

Enter a car registration number to a random access file of stolen cars. The registration is a string 6 characters long and of the form ‘ABC123’. The registration string is converted to a int number by concatenating the ASCII values of the three letters and the actual numeric values of the three digits i.e. ‘ABC123’ becomes ‘656667123’. The number of entries on the database is less than 100, so this int value is divided by 101 to give a remainder which is the address on the random access file where the car registration is to be stored as 6 bytes. Write a program to do this and test your program with a few car registration numbers and then printing out the whole file.




Aucun commentaire:

Enregistrer un commentaire