In programming some problems require making decisions.
A decision making is a basic programming construct that allows execution of instructions if a condition is true.
Write a program (Speed) that allows the user to enter the speed that he travels when he is on the road to Dubai. The program with then display a based on his rate of speed. If he drives faster than 120, he is speeding; otherwise he is driving within the speed limit.
if (speed > 120) { outputLabel.Text = "You are SPEEDING!" } else { outputLabel.Text = "You are within the speed limit." }
Write a program (SalesBonus) that allows a salesman to input the amount of sales he has made this month. The program will give a message telling him if he will get a bonus.The company gives a bonus of AED 500.00 (BONUS) if monthly sales are more than 25,000.00 (HIGH_SALES).
if (sales > HIGH_SALES) { MessageBox.Show("You earned a bonus of " + BONUS.ToString("c")); } else { MessageBox.Show("Sorry, you sales are less than " + HIGH_SALES.ToString("c")); }