I’m working on a C Programming exercise and need an explanation to help me learn.
In this assignment we are going to rewrite the ReadDouble function to make it more user friendly. Instead of reading a value into a double, read the users input into a string, similar to what was done with the ReadInt function in the video. Using the functions found in cctype, parse the string to validate that the input is a valid real number. It should use the following rules
The first character can be a number, +, -, or a decimal point
All other characters can be numeric, a comma or a decimal point
Any commas must be in their proper location (ie, separating hundreds from thousands, from millions, etc)
No commas after the decimal point
Only one decimal point in the number
Create a main function where you will call the ReadDouble function and display the value that is returned. Run this program several times demonstrating its error checking functionality
There are no bids yet.
All Rights Reserved, Dataedy.com 2020