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
Which statement best justifies the use of a high-speed cache in a CPU?
crimeas [40]

Cache memory is a high-speed memory that stores the instructions and data that have been frequently accessed.  It decreases the time it takes to decode the instructions stored in the instruction pipeline.

A.  It decreases the time it takes to decode instructions stored in the instruction pipeline.

<u>Explanation:</u>

Whenever an instruction is invoked or some data is accessed, the CPU looks for it in the cache memory before accessing the main memory.

If the content is found in the cache memory, it accessed from there and then and hence the access time and decode time is reduced as there were no main memory lockups.

6 0
3 years ago
After you select your recipients, the next step in using the Mail Merge Wizard would be to _____.
NARA [144]

Answer:

Write your letter

Explanation:

When using a Mail Merge Wizard in a Microsoft Word Document, this is the process.

  • Click on your document type
  • Click on the starting document
  • Select the recipient(s)
  • Write your letter and add some custom fields
  • Insert your address Block
  • Strike enter and click on Greeting line (to enter a greeting)
  • Preview your letter and click on complete merge
3 0
3 years ago
Read 2 more answers
__________ states that network connection speeds for high-end users will increase by 50 percent per year, enabling new companies
Liula [17]

Answer:

Nielsens law

Explanation:

4 0
1 year ago
Which strategy would most likely improve a student's reading comprehension?
Fynjy0 [20]

Answer:

I think asking questions is the best.

Explanation:

I believe asking questions are the best because you get to understand the text which is really good. Some 7th grade reading teachers can help you a lot and you can use iLit to help a bunch.

8 0
3 years ago
Read 2 more answers
2.3 Code Practice: Question 2
IRISSAK [1]

Answer:

Codes are given below:

Explanation:

Since the language is not specified, I am writing it in c++. I have added comments to explain each line

#include <iostream>

using namespace std;

int main() //Start of main function

{

int feet1, feet2 , inches1, inches2, t_feet, t_inches;  //declaring the variables

cout << "Enter the Feet for the first piece of fabric:"<<endl;

cin >> feet1; //this will take the feet piece1 as an input

cout << "Enter the Inches for the first piece of fabric:"<<endl;

cin >> inches1; //this will take the inches piece1 as an input

cout << "Enter the Feet for the second piece of fabric:"<<endl;

cin >> feet2; //this will take the feet piece2 as an input

cout << "Enter the Inches for the second piece of fabric:"<<endl;

cin >> inches2; //this will take the inches piece2 as an input

t_feet = feet1 + feet2;  //adding the feet

t_inches = inches1 + inches2; //adding the inches

if (t_inches> 11)  //checkimg if the inches are greater than 11

{

   t_feet = t_feet + t_inches/12;  //converting inches to feet that are greater than 12

   t_inches = t_inches%12; //getting the remaining inches after converting them to feet

}

cout <<"The total length: " <<  t_feet <<" feet and" << t_inches <<" inches" << endl;

return 0;

}  //End of main function

3 0
3 years ago
Other questions:
  • There are many differenttypes of models, but an individual DSS can consist of onlyone.
    15·1 answer
  • Which of the following refers to a feature of wikis that allows the restoring of earlier work in the event of a posting error, i
    9·1 answer
  • The four key stages with regards to data visualization workflow. Select one key stage and explain it briefly about that stage.St
    10·1 answer
  • Banking Account
    9·1 answer
  • Directory servers from different vendors are synchronized through ________.
    9·1 answer
  • Which of the following actions is an example of "window dressing?" a. Using some of the firm’s cash to reduce long-term debt. b.
    13·1 answer
  • Which of the following is the best reason to use a macro?: *
    14·1 answer
  • An internet connection is required to access which type of software?
    5·1 answer
  • Which of the following statements are true?
    11·1 answer
  • A program runs from start to finish, producing unexpected results, though no error message is received. What most likely occurre
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!