Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

C# Code for a calculator type app

$
0
0

I am working on using the below scenarios...just so you get an idea of the results I am wanting...need some idea of how to get these results. The && sign is not working (I get an error) not sure how to make these work so I can do the calculations needed. Basically it boils down to if the item price is less than 100 and the discount indicator sum is greater than 3, it is given a 20% discount, if price is between 100 and 149.99 and the discount indicator is given a 25% discount, however, if the item is above 149.99 and the sum is greater than 3, it gets a $30.00 discount. If sum of discount indicators is less than 3 then it is a 0% discount. I have everything working except the below scenario and cannot figure it out....the value 69 is 1 for less than 100, 2 for 100 - 149.99 and 3 for above 149.99. Please help!!

if(sum1>3 and value69=1)

result20= .20

textBox20.Text = result20.ToString();

if (sum20 < 3)
                    result20 = 0;
                textBox20.Text = result20.ToString();

if (sum20 > 3) and(value69 = 2);
                        result20 = 0.25;
                        textBox20.Text = result20.ToString();

if (sum20 > 3) and(value69= 3);
                            result20 = 30.0;
                            textBox20.Text = result20.ToString();


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>