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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!