The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 407 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Write a program in C++ that reads several integers from an input file (one at a time), and displays the value between 0 to 999 (of each one) in words. If the number is negative, negate it to get the postive. Stop when you get to the end of the file.
You MUST use an input file, while loop and functions with a switch statement in each (one to print the hundreds digit in words, one to print the the tens digit in words, one to print the ones digit in words). Hints: get the ones digit using % operator (save it in a local int variable), get the tens digit by dividing by 10 and % 10 (save it in another local int variable), get the ones digit (similar way as tens), and save it in another local int variable.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll