Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

given below program in c# using .net framework please do the following on this program 1-Modify the program to use a static method to calculate

given below program in c# using .net framework please do the following on this program

1-Modify the program to use a static method to calculate distance

2-Modify the program to use a non-static method to calculate distance 3 - what is the difference in your computer memory when using the static vs non-static method 4- create a dll for distance

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;

namespace Distance { class Program { static void Main(string[] args) { Console.WriteLine("Please enter value for x1"); double x1 = Double.Parse(Console.ReadLine());

Console.WriteLine("Please enter value for y1"); double y1 = Double.Parse(Console.ReadLine()); Console.WriteLine("Please enter value for x2"); double x2 = Double.Parse(Console.ReadLine()); Console.WriteLine("Please enter value for y2"); double y2 = Double.Parse(Console.ReadLine());

double XdiffSquared = (x2 - x1) * (x2 - x1); double YdiffSquared = (y2 - y1) * (y2 - y1); double differenceSquared = XdiffSquared + YdiffSquared; double distance = Math.Sqrt(differenceSquared); Console.WriteLine("The difference between two points is {0}", distance); Console.ReadLine(); }

} }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions