How to enter numerical data?

Does that change anything?

Yes,
it means you have to have a terminating key like enter to tell your program you have finished.

It also means you have to have a boolean variable that keeps track of if a decimal point has been entered and treats then digits differently depending on its value.