Answered step by step
Verified Expert Solution
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.
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
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