Question: GO Programming Language Write a function that does the following: A prompt message is passed to this function as the one parameter The function will
GO Programming Language
- Write a function that does the following:
- A prompt message is passed to this function as the one parameter
- The function will return a float64 and an error
- The function should read the string into a buffered reader. If an error occurs, zero should be returned along with an appropriate error message.
- The function should convert the string to a floating point number. If an error occurs, zero should be returned along with an appropriate error message.
- The function should check to see if the number is not positive. If so, zero should be returned along with an appropriate error message.
- The function should return the floating point number and nil
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
