C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 10-22-2009, 09:14 AM   #16
Registered User
 
Join Date: Aug 2006
Posts: 91
That whole problem can be done with nested if/else clauses... Not exactly pretty, but doable.

The best way, if you understand the math now, is simply to pick some sample numbers, and for each, write down (not code, just steps) of how you would break it down and solve it.

Basically,

Code:
Balance = Income
If Income > bracket1 {
   If Income > Bracket2 {
      If Income > Bracket3 {
         Do fixed stuff for Bracket1 and Bracket2, calculate out and add in remainder
      }
   }
   Else {
      Do Fixed Stuff for Bracket1, calculate out and add in remainder
   }
Else {
   Calculate out tax for partial Bracket1
}
rdrast is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A little problem about an idea, help please louis_mine C++ Programming 3 09-10-2004 09:52 PM
Coding Team WildFire A Brief History of Cprogramming.com 27 06-25-2004 07:14 PM
Terrain engine idea Bubba Game Programming 15 04-03-2004 01:30 AM
New idea on conveting byte to bits/bits to byte megablue C Programming 10 10-26-2003 01:16 AM
totally screwed up idea iain A Brief History of Cprogramming.com 9 08-17-2001 12:09 PM


All times are GMT -6. The time now is 09:54 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22