Yeah. If you have two programs, and in the Main method of each you do what you need, all you have to do is something like this:
You have: Main1 & Main2. Main1 Prompts for username & password. Main2 reads from file & prints the student ID.
Since both of these are methods on their own, just make them a method in a third file, then call them both.
Main3 is your final file, which actually puts them together.
Main3 ()
{
User&Pass function() aka Main1;
ReadFromFile function() aka Main2;
}
in the same file, copy Main1 & Main2, rename them whatever(then call 'whatever')
Now that I re-read, this is exactly what Ken g6 said, just more visual.
Hope it helps, and feel free to ask if you don't understand.