Question: Instructions: Write your C# solution and test your program for the specification below Copy and Paste the code for your solution in the places provided

Instructions:

  1. Write your C# solution and test your program for the specification below

  2. Copy and Paste the code for your solution in the places provided

class GpsLocation{

public double latitude, longitude;

...

}

class OrderedQueue{

// enqueue - Adds a GpsLocation in ascending order by latitude

// dequeue - removes and returns the GspLocation at the head of the queue

// isEmpty - Returns true if the queue is empty and false otherwise

// peek - returns the GpsLocation at the top of the queue, null if there is none(does not

remove it)

// returns a string list for each gps

}

Class GpsStack{

//push - adds a new GpsLocation to the top of the stack

//pop - removes and returns the GpsLocation at the top of the stack (reurns null if the stack is

empty)

//isEpty - returns true id the stack is empty and false other wise

//peek - returns the GpsLocation at the top of the stack (does not remove it)

}

Class Program{

OrderedQueue q = new OrderedQueue(0, 100);

q.enqueue(26.3, 11.2);

q.enqueue(27.0, 12.98);

q.enqueue(29.67, 9.3);

q.enqueue(28.4, 9.3);

Console.Write(q.printQueue());

// remove each object from the orderedQ and add it to the gpsStack

q.dequeue(1);

q.dequeue(2);

q.dequeue(3);

q.dequeue(4);

// remove each gpsLocation from the stack and print the information (latitude and longitude) of each gpsLocation object after it was removed.

Console.ReadKey();

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!