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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started