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]
4 years ago
7

Your project must satisfy the following requirements:

Computers and Technology
1 answer:
melomori [17]4 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
James, a system administrator, is tasked to update the BIOS and firmware of the computer in his organization. What are the reaso
Xelga [282]

Answer:

One reason to update BIOS and firmware is to ensure they support new hardware like CPU model or graphic card. In some cases, the updates can also resolve overheating issue or motherboard issue.  

However, this is not always the case that we must update the BIOS every time there is a new release because the latest update may cause problem to existing system as well.

As a general rule, only when there are some problems with the existing BIOS and firmware, we are only required to update them.

7 0
3 years ago
If you want to change the speed of a layer's horizontal scrolling, what should you change?
kirill [66]

Answer: A; X coefficient

Explanation: Hope I helped out !

-Carrie

Ps. it would mean a lot if you marked brainliest

6 0
3 years ago
A ________ record is a resource record that allows other servers to deliver Internet mail using SMTP.
Novay_Z [31]

The resource record that allows other servers to deliver Internet mail using SMTP is called; Mail Exchanger (MX)

<h3>Use of Mail Exchanger </h3>

The correct answer to the blank part of the question is "Mail Exchanger(MX)". This is because a mail exchanger record is simply an MX record that identifies the mail server that has the responsibility of accepting email messages on behalf of a domain name.

Now this Mail Exchanger also operates by allowing other servers to deliver Internet mail with the aid of SMTP(Simple mail transfer protocol)

Read more about SMTP at; brainly.com/question/14568877

4 0
2 years ago
A customer uses an app to order pizza for delivery. Which component includes
ankoles [38]

~frestoripongetosarangeou

5 0
2 years ago
Another name for divergent boundaries that occur under the ocean is
Sphinxa [80]
I believe it's seafloor spreading.
4 0
3 years ago
Read 2 more answers
Other questions:
  • In this scenario, two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends deci
    7·2 answers
  • What limits the impact of vehicle balance on view ghost ability during emergency vehicle maneuvers?
    15·1 answer
  • What sequence is used to create a brochure document from a template?
    8·2 answers
  • What is and effective way to display calculation in a word document?
    5·1 answer
  • Which feature of a router provides traffic flow and enhances network security?
    6·1 answer
  • Say you are running a program along with many other programs in a modern computer. For some reason, your program runs into a dea
    7·1 answer
  • Suction cup-type headlamp aiming equipment may be used on:
    11·1 answer
  • Suppose h(m) is a collision-resistant hash function that maps a message of arbitrary bit length into an n-bit hash value. is it
    5·1 answer
  • What are the six things you will learn this week on Scratch?
    8·1 answer
  • What is the datapath of add instruction?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!