Here is a link to a tutorial that I typed up where you could convert an old Hello World application from a 30 year old toy computer into a real console application written in C#, this is a fun example, and I look forward to cracking open even more possibilities from days of old:

Cool, huh? Now let's see how well a C# console application would look the other way around... Just thought this would be a cool experiment, see how well your knowledge is of old, old line numeric code would compare to object-oriented coding of today.

What would be cool IMO would be a modern program that loads old BASIC files and interprets them.

__________________
[...] We view customers as complete morons that will never catch on and [...] we're lying to them all the time. (Gabe Newell, Valve)
I'm the worst enemy in film-making and a completely talentless idiot. (Uwe Boll)
Faith is why you are wrong. (Crosma)

That's true...but I was just showing how line numbered programming can be converted to OOP through more modern languages like C# and/or Java. Let's see if I can come up with another example that'll be fancier than Hello World...that was just too easy.

All right, here's a program called "Marching Numbers." Now let's see how well we can convert this one:

Now I'm not certain that this conversion would exactly be 100%, but it does show how important it is to be able to determine, based on line number references, where to either create a new class and/or method, and if you need to make an if or a for statement, associate the line numbers, and develop a code block with all the involved lines of code. It's a weird science, I do admit, but there are key elements in older code to look for when attempting to convert it to a newer language. Just throwing that out there.

your examples make no practical sense. In the real world you probably have thousands of these programs. Doing conversions on that scale will likely be error prone and problematic. A better solution would be to write hooks to say an enterprise service bus. That would allow the old programs to pass data back and forth with modern programs. Then the next step will be to get a replacement of the old programs and make the same hooks to the service bus. Then voila, swap out the old with the new.