Hi I am trying to write an app for price calculations what i need to do is make cut off points for different dollar values the values are when a product is over $22.00 the deduction $3.30. When a product is over $16.50 and under $22.00 the deduction is dollar value -15%-$1.81 and when the product is under $16.50 the deduction is dollar value -24%-.32cents.I am new to code writing and need help thankyou barry t
barry t
0
Newbie Poster
Recommended Answers
Jump to PostHi I am trying to write an app for price calculations what i need to do is make cut off points for different dollar values the values are when a product is over $22.00 the deduction $3.30. When a product is over $16.50 and under $22.00 the deduction is dollar …
Jump to PostI'm assuming you meant 22.00 OR Great and 16.50 OR Greater
double valueAfterDeduction(double oldValue){ if(oldValue >= 22.00) oldValue -= 3.3; else if(oldValue >= 16.5) oldValue = (oldValue * .85) - 1.81; else oldValue = (oldValue * .76) - .32; return oldValue; }
All 6 Replies
tayspen
28
<Insert title here>
Team Colleague
barry t
0
Newbie Poster
campkev
0
Posting Pro in Training
barry t
0
Newbie Poster
barry t
0
Newbie Poster
campkev
0
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.