Calculate area and perimeter solved

Calculate area and perimeter solved

Calculate area and perimeter solved
Calculate area and perimeterIn this exercise, you’ll create a form that accepts the length and width of a rectangle from theuser and then calculates the area and perimeter of the rectangle.1.Start a new project named AreaAndPerimeter.2.Add labels, text boxes, and buttons to the default form and set the properties of the formand its controls so they appear as shown above. When the user presses the Enter key, theClick event of the Calculate button should fire. When the user presses the Esc key, theClick event of the Exit button should fire.3.Create an event handler for the Click event of the Calculate button. This event handlershould get the values the user enters for the length and width, calculate and display thearea (length x width) and perimeter (2 x length + 2 x width), and move the focus to theLength text box. It should provide for decimal entries, but you can assume that the userwill enter valid decimal values.4.Create an event handler for the Click event of the Exit button that closes the form.5.Test the application to be sure it works correctly

Accumulate test score dataIn this exercise, you’ll create a form that accepts one or more scores from the user. Each timea score is added, the score total, score count, and average score are calculated and displayed.1.Start a new project named ScoreCalculator.2.Add labels, text boxes, and buttons to the default form and set the properties of the formand its controls so they appear as shown above. When the user presses the Enter key, theClick event of the Add button should fire. When the user presses the Esc key, the Clickevent of the Exit button should fire.3.Declare two class variables to store the score total and the score count.4.Create an event handler for the Click event of the Add button. This event handler shouldget the score the user enters, calculate and display the score total, score count, andaverage score, and move the focus to the Score text box. It should provide for integerentries, but you can assume that the user will enter valid integer values.5.Create an event handler for the Click event of the Clear Scores button. This event handlershould set the two class variables to zero, clear the text boxes on the form, and move thefocus to the Score text box.6.Create an event handler for the Click event of the Exit button that closes the form.7.Test the application to be sure it works correctly
Powered by