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
In what ways do you think the media should function in a democratic society?
insens350 [35]

Answer:

i think it should slow down

Explanation:

i think this because people are always on social media so they should put down their devices and interact with others and sometimes they are violent on their devices so it would be better if people did stay off their devices for a little bit.

7 0
3 years ago
A computer reads a sequence from top to bottom and left to right? True or False
Nat2105 [25]
The answer is False
5 0
2 years ago
Given the following function definition:
neonofarm [45]

The question is incomplete! Complete question along with its step by step answer is provided below!

Question:

Given the following function definition:

void calc (int a, int& b)

{

int c;

c = a + 2;

a = a * 3;

b = c + a;

}

x = 1;

y = 2;

z = 3;

calc(x, y);

cout << x << " " << y << " " << z << endl;

What is the output of the following code fragment that invokes calc?

a. 1 2 3

b. 1 6 3

c. 3 6 3

d. 1 14 9

e. None of these

Answer:

b. 1 6 3

Explanation:

In the given problem we have a function void calc which takes two input arguments a and b and updates its values according to following equations

c = a + 2;

a = a * 3;

b = c + a;

Then we call this function calc(x,y) by providing test values of

int x = 1;

int y = 2;

int z = 3;

and the output returns the values of x, y and z

cout << x << " " << y << " " << z << endl;

Lets find out what is happening here!

When the program runs we provide x=a=1 and y=b=2

c=a+2=1+2=3

a=a*3=1*3=3

b=c+a=3+3=6

So the updated values of a=x=3 and b=y=6?

NO!

The updated values are a=x=1 and b=y=6

WHY?

There are two ways to pass values

1. Pass by values -> value cannot change  (int a)

2. Pass by reference -> value can change (int& b)

Look at the function void calc (int a, int& b) ;

Here we are passing (int a) as a value and (int& b) as a reference, therefore x remains same x=1 and y gets changed to updated value y=6 and z remains same as z=3 since it wasnt used by function calc(x,y)

The right answer is:

b. 1 6 3

x=1, y=6, z=3

4 0
3 years ago
Isabel is creating a wireframe. She has drawn a layout for the home page along with outlining the navigation elements. She now w
Juli2301 [7.4K]

Answer: Filler content

Explanation: I think what the question is getting at is using filler content. This includes filler images and sample text. Once the website is all set up, the filler content is replaced with the actual content.

3 0
3 years ago
Read 2 more answers
You work for a retail clothing chain whose primary outlets are in shopping malls and are conducting an analysis of your customer
Alla [95]

Answer: Identifying sequences

Explanation:

Since the user wants to know if there are any particular activities that the customers engage in, or the types of purchases made in the month before or after purchasing select items from your store, therefore, the data mining software can be used in identifying sequences.

In this case, the data mining software can't be used in classifying data whether into structured or unstructured data. Furthermore, the identification of clusters and associations aren't the correct answers.

Therefore, the best option is B.

5 0
3 years ago
Other questions:
  • In microsoft word, when you highlight existing text you want to replace, you’re in
    14·1 answer
  • Why does a satellite requires two bridges?
    11·1 answer
  • The use of themes in WordPress is a good illustration of what major concept?
    6·1 answer
  • Consider the packets exchanged in TCP connection setup between Host A and Host B. Assume that Host A's initial sequence number i
    7·1 answer
  • Jjhb ft fv tuning Denise l Debbie
    9·1 answer
  • Insertion point shows where the typed text will appear.
    5·1 answer
  • 3. Which swim_backwards method is called when sammy.swim_backwards() is executed? Why?
    8·1 answer
  • 15. You read a news article that's politically biased and not well organized. It's
    6·1 answer
  • How to use boolean to check if math answer is correct java
    7·2 answers
  • an engineer is writing a web application that requires some user input. the engineer has put a submit button on their page and n
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!