Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum denomination get_denum(enum denomValue val) {
- /* yeah, this is gonna be some shitty hard coded conversion, if i think of a way and or get time ill make it nice */
- if(val == 5) return FIVE_CENTS;
- if(val == 10) return TEN_CENTS;
- if(val == 20) return TWENTY_CENTS;
- if(val == 50) return FIFTY_CENTS;
- if(val == 100) return ONE_DOLLAR;
- if(val == 200) return TWO_DOLLARS;
- if(val == 500) return FIVE_DOLLARS;
- if(val == 1000) return TEN_DOLLARS;
- return NULL;
- }
- enum denomValue get_value(enum denomination den) {
- if (den == FIVE_CENTS) return 5;
- if (den == TEN_CENTS) return 10;
- if (den == TWENTY_CENTS) return 20;
- if (den == FIFTY_CENTS) return 50;
- if (den == ONE_DOLLAR) return 100;
- if (den == TWO_DOLLARS) return 200;
- if (den == FIVE_DOLLARS) return 500;
- if (den == TEN_DOLLARS) return 1000;
- return NULL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement