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: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 3 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
bool isNumeric(string SSN);
//use ASCII to determines if a string contains only the characters 0-9
void displayFormattedNumber(string SSN);
//Calls the formatSSN function and then displays it to the console
//With the message "You entered: " followed by the SSN
string formatSSN(string SSN);
//helper function to displayFormatted SSN
//converts a 9 character string into an SSN in the format XXX-XX-XXXX
Â
Please enter a 9-digit SSN (no spaces no punctuation): 12345
You entered too few digits. Please try again.
Â
Please enter a 9-digit SSN (no spaces no punctuation): 123456789012345
You entered too many digits. Please try again.
Â
Please enter a 9-digit SSN (no spaces no punctuation): 123 456
You entered too few digits. Please try again.
Â
Please enter a 9-digit SSN (no spaces no punctuation): 123 456 7890
Please enter a number with no spaces or punctuation. Please try again.
Â
Please enter a 9-digit SSN (no spaces no punctuation): 123-45-6789
Please enter a number with no spaces or punctuation. Please try again.
Â
Please enter a 9-digit SSN (no spaces no punctuation): 123456789
You entered: 123-45-6789
Â
bool not_valid_SSN = true;
do {
    //user input
    if (test for too short) {
       //display appropriate error message
    } else if (!is_numeric(SSN)) {
       //display error message
    } else if(test for too long) {
       //display appropriate error message
    } else {
       //display appropriate formatted phone number
       not_valid_SSN = false;
    }
} while(not_valid_SSN);
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly