Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can someone help i dont why i am having all these errors please help 3 references public partial class frmareaAndParameter : Form 1 reference public
can someone help i dont why i am having all these errors please help
3 references public partial class frmareaAndParameter : Form 1 reference public frmAreaAndParameter() InitializeComponent(); 1 reference private void btnCalculate_Click(object sender, EventArgs e) 1/create the values that will hold the variables from the textbox int lenght, width; if (!int. TryParse(txtLenght. Text, out lenght)) ; MessageBox.Show("Enter valid lenght"); else if (lint. TryParse(txtwidth. Text, out width)) MessageBox.Show("Enter valid width"); else int area - lenght * width; int perimeter - 2. (lenght + width); txtArea. Text - area.ToString : txtPerimeter.Text - perimeter.ToString(); Error Lise of 2 Messages et Solution 7 .1 Warning Code Description 58641 else cannot start a statement 3 CS1003 Syntax error,' expected 3 S125 inwalid pression terme C51006 )pected 3 155 depression terme Build Intel Sense 1 O Type here to search 0 e ISTM250 - Homework Assignment 3 Homework 3, Problem 1 In this exercise, you'll create a form that accepts the length and width of a rectangle from the user and then calculates the area and perimeter of the rectangle. Area And Perimeter Length: Width: 25 100 Area 2500 Peeter 250 Calculate 1. Start a new project named AreaAndPerimeter. 2. Add labels, text boxes, and buttons to the default form and set the properties of the form and its controls so they appear as shown above. When the user presses the Enter key, the Click event of the Calculate button should fire. When the user presses the Esc key, the Click event of the Exit button should fire. 3. Create an event handler for the Click event of the Calculate button. This event handler should get the values the user enters for the length and width, calculate and display the area (length x width) and perimeter (2 x length + 2 x width), and move the focus to the Length text box. It should provide for decimal entries, but you can assume that the user will 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 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started