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
What is a browser cookie?
nikitadnepr [17]

B) its a small peice of data that tracks your preferances on diffrent websites

Have a great day !

6 0
3 years ago
Read 2 more answers
Which institution developed outside the limits of the written costitution of the united states ?
nignag [31]
The answer is D. Electoral College
4 0
2 years ago
If you sort a portion of an Excel sheet and you get an error message such as #DIV/0, what is a likely cause of the error message
yulyashka [42]
<span>If you sort a portion of an Excel sheet and you get an error message such as #DIV/0, the cause of the error message is (B) one or more cells containing absolute cell references. The possible reason of this error message includes: (1) e</span><span>ntering division formula that divided by zero (0), (2) and that is being used as a reference.</span>
7 0
3 years ago
In a batch operating system, three jobs are submitted for execution. Each job involves an I/O activity, CPU time and another I/O
Ilia_Sergeevich [38]

Answer:

a) CPU utilization for uniprogramming system = 18.2%

b) CPU utilization for multiprogramming system = 41.379%

Explanation:

IO time = total time – CPU time

For JOB 1  

CPU time = 3ms ,

total time= 23ms

IO time = 23-3 = 20ms ,

For JOB 2

CPU time =5ms

total = 29ms

IO time = 29-5 = 24ms  

For JOB 3  

CPU time = 4ms

total = 14ms

IO time = 14-10 =10ms  

1.) In uniprogramming system, operations are performed sequentially

CPU utilization=total CPU time / total real time

CPU utilization =(3+5+4) / (23+29+14)

CPU utilization =0.182 or 18.2%

2) In multiprogramming system, jobs wait for the CPU to get free while performing IO operations concurrently

steps followed by the os

1. IO for 1st job                           at 0ms

2. IO for 2nd job                          at 0ms

3. IO for 3rd job                          at 0ms

4. CPU time for 3rd job              at 5ms

5. Next IO job for 3rd job           at 9ms END at 14ms

6. CPU time for 1st job              at 9ms

7. Next IO job for 1st job           at 14ms END at 23ms

8. CPU time for 2nd job             at 14ms

9. Next IO job for 2nd job          at 15ms END at 29ms

CPU time is 3+5+4 =12ms

Total execution time = 29ms

CPU utilization = 12*100/29= 41.379%

5 0
2 years ago
Differentiate between Scope and Linkage
Lera25 [3.4K]

Answer: The difference between the scope and linkage is as follows:-

  • Scope of the variable is defined as the variable view from different program parts whereas the linkage is described as the link that is made between the variable and the declaration function having the common name.
  • Scope of variable describes about the existing time of the variable in the program whereas linkage is defined for the name of variable present in the program is available at all time .

6 0
3 years ago
Other questions:
  • For a loop counter, the appropriate data type would be:
    14·1 answer
  • Create a new conditional format that applies yellow fill (fourth color under Standard Colors) and bold font to values that conta
    14·1 answer
  • You should use the longest possible shutter speed for all firework photographs.
    8·2 answers
  • Sarah, a computer user, tells James, a computer technician, that the network she is connected to is running too slowly. Which of
    5·1 answer
  • What is a major way that a consumer can protect himself/herself when getting a credit card? A) Making sure that they get a very
    8·1 answer
  • Identify at least five different Information Technology careers that you could pursue in your home state, and choose the three t
    10·2 answers
  • Many businesses use robotic solutions. Which department of the food and beverage industry uses robotic solutions on a large scal
    10·2 answers
  • Operating systems provide a measure of security by allowing users to access to those resources they've been cleared to use as we
    8·1 answer
  • You can use this keyboard shortcut to toggle the visibility of the command line. If for some reason your command line is hidden
    7·1 answer
  • The people, procedures, hardware, software, data, and knowledge needed to develop computer systems and machines that can simulat
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!