Answer to Question #254897 in Algorithms for Israel

Question #254897
Algorithm for a windows application that contains two textboxes and three buttons. The textboxes should be used to allow the user to input two positive numeric values. The buttons should be labeled Add, Multiply and Reset. Create event handler methods that retrieve the values, perform the calculations and display the result of the calculations on a label. The result label should initially be set to invisible with a font color of yellow. If invalid data is entered, change the font color to red on the result label and display the message saying “value must be numeri and >0”. When the final answer is displayed, the font color should be yellow. Additional labels will be needed from the textboxes captions. Do not allow non numeric characters to be entered. Invoke the TryParse() method to retrieve the values. All controls involved in program statements should be named. Right justify values in the textbox.
1
Expert's answer
2021-10-22T06:36:24-0400
Start
   Declare variables: number1,number2,result
   Read number1 from the textbox
   Read number2 from the textbox
   If button "add" is click then  
      if number1 is correct and number1 is correct then
        result = number1 + number2
	Display result in label
        Change the font color to yellow
      else 
         Display message:  "value must be numeri and >0"
      end if
   end if
   If button "Multiply" is click then  
      if number1 is correct and number1 is correct then
        result = number1 * number2
	Display result in label
        Change the font color to yellow
      else 
         Display message:  "value must be numeri and >0"
      end if
   end if
   If button "Reset" is click then  
      Reset all textboxes and label
      Change the font color
   end if
Stop

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS