Simple question on File

May I know how the code should look like to do the following :



(0) The program should prompt user to enter a string length of 30(alpahnumeric)



(1) I need to create a sequential file that for each record written to the file , it should be length of 33(string of length 30 + 3digits). The 3 digits is random number generated by program



(2) Therefore for each user record that is written to the file , it should look something like this e.g Howareyou419 in the file view.



(3) Next time , if I want to search the file, in the program . I just need to input the key , Howareyou . It will automatically return to me 419.



(4) by the way , 419 is a unique number created for each user for each new record created.Therefore the program should automatically create a random number(of range 1-419) when the user enter the string "Howareyou"



I am novice in Files. Thanks for the help :-)


Comments

  • : May I know how the code should look like to do the following :

    :

    : (0) The program should prompt user to enter a string length of 30(alpahnumeric)

    :

    : (1) I need to create a sequential file that for each record written to the file , it should be length of 33(string of length 30 + 3digits). The 3 digits is random number generated by program

    :

    : (2) Therefore for each user record that is written to the file , it should look something like this e.g Howareyou419 in the file view.

    :

    : (3) Next time , if I want to search the file, in the program . I just need to input the key , Howareyou . It will automatically return to me 419.

    :

    : (4) by the way , 419 is a unique number created for each user for each new record created.Therefore the program should automatically create a random number(of range 1-419) when the user enter the string "Howareyou"

    :

    : I am novice in Files. Thanks for the help :-)

    :






Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories