Question: Create on c # a class City that contains two attributes. The City class contains two member variables / attributes: string name; int temp; which

Create on c # a class City that contains two attributes.

The City class contains two member variables / attributes:

string name; int temp;

which stores the city's name and temperature, as well as the function / method ToString

public string ToString ()

which returns a string that contains values in the attributes name and temp. Note that the member function / method ToString () does not generate a print to the console.

And write a function / method for linear search in a field (array, vector, list) cities with City objects. int linsok (field cities, int n, int search temp)

The function / method should search a field of cities for a city with a specific temperature (temp) and return the index for that city. If no city with that temperature is found, -1 is returned. The variable n is the number of elements in the field. Write pseudocode and draw flow charts for search method / function.

Also write a function / method that sorts a City field by temperature (called first). void bubblesort (field cities, int n)

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!