b0ng01's Profile User Rating: -----

Reputation: 38 Craftsman
Group:
Contributors
Active Posts:
170 (0.12 per day)
Joined:
16-July 10
Profile Views:
3,233
Last Active:
User is offline Jun 21 2012 07:54 AM
Currently:
Offline

Previous Fields

Dream Kudos:
50
Icon   b0ng01 dumb bug of the day: void setValue(int d)(d=this.d;)

Posts I've Made

  1. In Topic: Convert number symbols to words

    Posted 20 Jun 2012

    	else if (number >= 20 && number < 100) //2 digit numbers, > 20
    	{
    
        int n =  (number / 10) % 10; // pulls off the tens place
        n -= 2;
    
    		cout <<  greaterThan19[n] << endl;//lessThan20[secondNum]<< " dollar";
    
        int secNum = (number % 10 ); // saves the ones digit into secNum
        cout << secNum << endl;
            cout << lessThan20[secNum ] << endl;
    
    

    You need to do what is done with n and secNum for the Hundreds and Thousands as well. I don't think it is a great idea to index into an array with the number you pulled from input but, it will work if you pay attention to how you setup your array. ie... notice I subtracted 2 from n.

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

Comments

Page 1 of 1
  1. Photo

    k1ngcor3y Icon

    12 Sep 2010 - 09:44
    I didn't know you were on codelearners too
Page 1 of 1