Code for user to input and read from file