This solution will use an item quantity and a state code to calculate the total price of an item. The solution will calculate the total cost of an item by multiplying the quantity ordered by one of two prices. For quantities less than 50 each item will cost $2.25. For quantities greater than or equal to 50, each item will cost $1.50. Should the state be Connecticut or Massachusetts, an extra $20 will be added to the total cost of the item.
Please answer!!!

Respuesta :

Answer:

Create one label and one textbox, and name them quatity, both of them. Now add another label, and name it Price. And add a button, and name it calcprice. Also add state textbox for state. Add a textbox and name it state

Now Double click calcprice button in design mode, and add in calcprice_click, code given below:

If Convert.ToInt32(quantity.Text) <50 and (state.Text != Connecticut or state.Text !=Massachusetts) Then  

   Price= Convert.ToInt32(quantity.Text) x 2.25

If Convert.ToInt32(quantity.Text) <50 and (state.Text == Connecticut or state.Text ==Massachusetts) Then  

   Price.Text= Convert.ToInt32(quantity.Text) x 2.25 +20

ElseIf Convert.ToInt32(quantity.Text) >=50  and (state.Text != Connecticut or state.Text !=Massachusetts) Then  

 Price.Text= Convert.ToInt32(quantity.Text) x 1.50

 Else

   Price.Text= Convert.ToInt32(quantity.Text) x 1.5 +20

 End If

Please add this code and it should work fine.

Explanation:

Please check the answer section.