Question: I just need code in C++ language Design and create a C++ class to convert a string representing a positive integer or positive decimal value

I just need code in C++ language

Design and create a C++ class to convert a string representing a positive integer or positive decimal value into the long int and double numeric types. If the string value represents a decimal value, the converted integer version will be truncated. If the string value represents an integer, the converted decimal value will have a decimal portion of zero.

Input Integer Decimal string conversion conversion

123 123 123.0

"12.45 12 12.45

Your design must use a character stack class in your conversion. You may use two stacks for the conversion if you wish. Your stack class must be based on the integer stack class developed in class (see handout). Your convert to numeric class should have member functions for the following tasks: an overloaded constructor that accepts the string to convert a convert member function that accepts a string and returns a boolean success status a getIntValue member function that returns the converted value as a long int a getDecValue member function that returns the converted value as a double Create a driver program to demonstrate your class. The driver will prompt the user and accept a string representing a positive integer or decimal, then use your class to convert it. Finally, demonstrate the converted value is useable with any type specic operation, both as a long int and double. A Design Document is required for this assignment. The Algorithm portion of your design document must describe both the conversion class and the driver program. The Flowchart portion of your design document should only depict the conversion process from string to numeric.

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!