1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lisa [10]
3 years ago
7

Your project must satisfy the following requirements:

Computers and Technology
1 answer:
melomori [17]3 years ago
7 0

Answer:

Check the explanation

Explanation:

using System;

using System.Collections;

namespace HelloWorldApplication

{

class Temperature{

public double degrees;

double scale; // use of this field is not specified

public override string ToString(){

return ("degrees:"+degrees+", scale:"+scale);

}

}

class Location{

int x;

int y;

public Location(int x, int y){

this.x = x;

this.y = y;

}

public double getDistance(Location otherLoc){

return Math.Sqrt((x-otherLoc.x)*(x-otherLoc.x) +(y-otherLoc.y)*(y-otherLoc.y) );

}

public override string ToString(){

return ("("+x+", "+y+")");

}

}

class Pool{

public Pool(){

count++;

}

public static int count=0;

public Location location;

public Temperature temperature;

public override string ToString(){

return ("location:"+location+", temperature:"+temperature);

}

}

class Driver

{

static void Main(string[] args)

{

Random r = new Random();

ArrayList list = new ArrayList();

Console.WriteLine("Before adding pool count : "+Pool.count);

Pool pool = new Pool();

pool.location = new Location(4,8);

pool.temperature = new Temperature();

pool. temperature. degrees =r. Next (98,105);

list. Add(pool);

Console. WriteLine("After adding pool count : "+Pool. count);

Console.WriteLine("Before adding pool count : "+Pool.count);

pool = new Pool();

pool.location = new Location(12,9);

pool.temperature = new Temperature();

pool. temperature. degrees =r.Next (98,105);

list.Add(pool);

Console.WriteLine("After adding pool count : "+Pool.count);

Console.WriteLine("Before adding pool count : "+Pool.count);

pool = new Pool();

pool.location = new Location(6,6);

pool.temperature = new Temperature();

pool.temperature. degrees =r.Next (98,105);

list.Add(pool);

Console.WriteLine("After adding pool count : "+Pool.count);

Location location = new Location(0,0);

// You can even use Minimum Spanning Tree algorithm to reduce the time complexity

Console.WriteLine("Path is : ");

while(list.Count > 0){

Pool selectedPool = null;

double dist =double.MaxValue;

foreach (Pool i in list)

{

if(i.location.getDistance(location) < dist){

selectedPool = i;

}

}

Console.Write(selectedPool + " >> " );

location = selectedPool.location;

list.Remove(selectedPool);

}

/* my first program in C# */

Console.WriteLine(" end.");

Console.ReadKey();

}

}

}

You might be interested in
While inspecting an element in the DOM on my website using the Chrome Devtools I accidentally deleted the DIV that had all my au
Kobotan [32]

Answer:

Refresh the page, it will reset all the underlying code.

Explanation:

Inspecting an element is essential for web developers in building websites faster and better. The Chrome DevTools is a powerful tool that is integrated into the Chrome browser to assist developers in on-the-go website troubleshooting.

Editing codes in the Chrome DevTools console does not affect the source code of the website hosted on a server, it just provides instant editing functions for troubleshooting or website enhancement.

Therefore, refreshing the page, re-loads the website again from its database which will show the unedited website. In our scenario, after refreshing the page, all the deleted DIV that contains all the authentication will reappear again.

4 0
3 years ago
How many keywords are there in C programming language
kumpel [21]
In total there are 32 keywords in the c programming language.
3 0
3 years ago
The encapsulation unit on the presentation layer of the osi model is
Zielflug [23.3K]
<span>The encapsulation unit on the presentation layer of the OSI model is the Data link layer (2).</span>
7 0
3 years ago
You are creating a program that can add up the amount of money the user spent that day. Right down to the penny! What kind of va
padilas [110]

Answer:A. A default Variable

Explanation:

5 0
2 years ago
Read 2 more answers
Nina is trying to learn more about how computers work. She has repeatedly read that the motherboard is the "brain” of the comput
Lady bird [3.3K]

Its

Processes the data on the computer .

5 0
2 years ago
Read 2 more answers
Other questions:
  • I want to customize my company's logo, name, address, and similar details in all my business documents what option should use?
    12·1 answer
  • A model release can be either oral or written down. true or false
    13·2 answers
  • Why is it important to minimize cable clutter in a rack?
    11·1 answer
  • The statement ____ declares intList to be a vector and the component type to be int
    8·1 answer
  • When an interrogator speaks highly about how a crime was committed, hoping to get the suspect to brag about his or her involveme
    7·2 answers
  • Were does igneous rocks cool?
    9·1 answer
  • Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores = {10, 20, 3
    13·1 answer
  • (25 POINTS) Some applications work on all devices while others work on some devices. True or False?
    13·1 answer
  • Guidewords for the word “serpent” may be
    8·2 answers
  • If I use the command right(90), which way will Tracy turn?<br> If correct I mark brainlist
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!