Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions