Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

code is for c++ and please make a new code.. font use the ones that are already in chegg and keep it simple as possible.

code is for c++ and please make a new code.. font use the ones that are already in chegg and keep it simple as possible. thanks.
image text in transcribed
Wine a C+' program that wil ahow the user to enter a currency amount and valdate that it is in a correct format. For purposes of this program, the coornoct fomat of curscy is the falowing $1294 The $ sign followod by an integer number S1234.56. The 5 sign followed by a real number. If a decimal point is included in the numbec, there must be exactly 2 digts to the right of ehe decimal point 41.23.56 There can be a negative sign before the dolle sign 12e A ooe or two digit integer followed by a cent sign. Creale a function that will do the validation and if valid, will coevert the namber to a "double* and return it to the calling function. Your main function should do the following: 1. Prompt the tuser to end a carrency amount 2. Read the inpot into a C-Style string. 3. Call the finction you created above to convert the amouns. If the amount is valid, then display the amount in the form of a real (deoble) amount 4. Prompt the user if they wish to enter a new value (yes/ no)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 2 Lncs 8056

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013th Edition

3642401724, 978-3642401725

More Books

Students also viewed these Databases questions

Question

Compare Gardners and Sternbergs theories of intelligence.

Answered: 1 week ago

Question

What is paper chromatography?

Answered: 1 week ago

Question

Explain the cost of capital.

Answered: 1 week ago

Question

Stages of a Relationship?

Answered: 1 week ago