Kody Snow

Kody Snow

  • NA
  • 10
  • 2.4k

If else statement for no input?

Sep 29 2015 10:47 PM

i have an assignment:

1. Create the project with a proper name. For example, BillingApplication.

2. Provide a proper name and text to the Form, see the picture above for Text.

3. Add the three labels at the top row – Product Description, Product Price, Product Quantity.

4. Add five rows of text boxes as shown in the picture.

5. Add the button “Calculate Total Price”.

6. Add the text box at the bottom. Make it “Read Only”. Hint: Use the property “ReadOnly”.

7. To the event handler of the button, add the logic for the following.

a. Use if-else: If no input is added to any of the text box, show the message in the message box “Please provide a full set of inputs: Product description, product price, and product quantity.”

b. Else, calculate the total price by add the products of prices and quantities. Create a variable of double type. Add all the prices of the products and assign them to the created variable (it is assumed that the user will enter valid values, so there’s no check for the validity of the inputs).

c. Set the text property of the bottom text box as the price. For example, if the price is 20 dollars, the textbox text should be “$20”. If the price is 20.25, the textbox text should be “$20.25”

I am stuck on is-else statement everytime i even begin to do a if(textbox.text == false) statement it loads up a thousand errors =(

can someone point me in the right direction


Answers (1)