Ask Experts Questions for FREE Help !
Ask
    Sundayy's Avatar
    Sundayy Posts: 1, Reputation: 1
    New Member
     
    #1

    Feb 22, 2011, 10:08 AM
    Using C++ (if, char or Boolean)
    Using C++ (if, char or Boolean)
    Write a program that asks the user for a two digit number and then prints the English word for that number.

    Sample run:
    Enter a two-digit number: 45
    You entered the number forty-five.

    PLAN: Read the number entered as an integer and then break the number up into 2 digits. (Recall how integer division and % work…if x is an int and has the value 45, then what’s x/10 and x%10?)

    Basically, use one switch statement to print the word for the first digit (“twenty”, “thirty” and so forth). Use a second switch statement to print the word for the second digit.
    Don’t forget the numbers between 10 and 19 require special treatment.
    Make sure you only print the ‘-‘ when needed…twenty-three needs the -, thirty doesn’t

Check out some similar questions!

It's a vampire novle kind of,The vamp isn't the main char [ 2 Answers ]

Ok I read this book a good while ago, may be 6-8 years ago. Its about this immortal who has a warewolf pal, and they go off to stop some crazy powerful vampire lady from destroying manhattan ( I think, I know it was somewhere in new york). Oh and the vampie lady can control like the elements...


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.