Question
Problem Create a personal library of data entry functions. Personal Namespace (Links to an external site.) Specification 1- Download dataChecks.cppPreview the documentView in a new
Problem
Create a personal library of data entry functions. Personal Namespace (Links to an external site.)
Specification
1- Download dataChecks.cppPreview the documentView in a new window and implement the following functions:
2- bool isValidInt( string str ) Returns true if str can be parsed into a valid int, false otherwise.
- int getInt() Returns a valid integer entered from the keyboard.
- bool isValidDouble( string str ) Returns true if str can be parsed into a valid double, false otherwise.
- double getDouble() Returns a valid double entered from the keyboard.
3- Each "get" function should do the following:
1. Prompt the user to enter the appropriate value.
2. Store the characters entered as a string.
3. Convert the string to the appropriate numeric value.
4. If the conversion fails, throw an exception and allow the user to re-enter the value. Save dataChecks.cpp in this directory structure: "c:\CSIS1600\MyCppUtils\dataChecks.cpp"
5. Write a test application ( ex.:DataEntryTest.exeView in a new window ) to validate that your functions work properly. In this source code file, include these two lines above main()
#include "C:\\CSIS1600\\MyCPPUtils\\dataChecks.cpp" using namespace dataChecks;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started