ENGR123 UCSD Programming Codes In C# Visual Studio

User Generated

jrerjbys

Programming

ENGR123

University of California San Diego

Description

the program needs to find the distance (farthest closest and the area details provided) between the point in Asn05.txt. can you write the codes for the buttons as it asked in asn05.pdf using c# visual studio? the program has the headers in the uploaded file (ASn05.zip)?

Asn05.txt

1, 1
2.4, 3.7
20, 43
46, 3
9, 33
-12, 5
-25, 5.9
-49, 42
-7, 7.4
-2.3, 37
6.7, -34
6.4, -3
45, -42
26, -21
10, -23
-12, -12
-35, -21
-37, -45
-10, -12
-25, -42

Unformatted Attachment Preview

Engr 123 Assignment 5 2-D Arrays Assigned: February 18, 2019 Due: March 6, 2019 This assignment will be done as a Windows Forms application. The form has been created for you and you should begin by downloading Asn5Form.zip from the web site. Unzip this file and use Visual Studio to open it as a project by double clicking on the solution file name. If you run the program you will get a screen similar to that shown in Figure 1 below. Click on the Load button to get a dialog box which will allow you to load Asn5.txt. This file is in the project folder under bin/Debug. Selecting the file causes it to be loaded into a twodimensional array named dataPoints. This array holds up to 20 points where dataPoints[i, 0] holds the x value for point i and dataPoints[i, 1] holds the y value for point i. All points are in Cartesian coordinates. The code behind the Load button has been written for you. For this assignment you must write the code behind the other four buttons. Figure 1 The GUI interface for Assignment 5 Button Farthest from origin Closest to origin Smallest Triangle Largest Triangle Function Displays the distance of the point that is farthest from the origin. Displays the distance of the point that is closest to the origin. Displays the area of smallest triangle that can be formed from the points. Displays the area of the largest triangle than can be formed from the points The distance between any point x1, y1 and the origin is given by distance = x12 + y12 To compute the area of a triangle use the formula: Area = s(s − a )(s − b)(s − c) where s = (a + b + c) / 2 and a, b, and c are the lengths of the three sides of the triangle. To calculate the length of the sides you can use the distance formula: Distance = ( x1 − x2 ) 2 + ( y1 − y 2 ) 2 where x1 , y1 are the coordinates of one point and x 2 , y 2 is the coordinates of the second point. Your program must be organized in modular fashion using methods. At a minimum you must have one method to calculate the distance and a second to calculate the area. Turn in a zipped project file. Name your zipped file Asn05XXX.zip where XXX are your three initials. Upload your zipped project file to \\cecsfp01\users\everyone\Engr123
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

The program is ready. I renamed the buttons, added fun...


Anonymous
Just the thing I needed, saved me a lot of time.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags