Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here is an exchange sort algorithm written in pseudo code: Exchange Sort of Array X[] For I = 0 to (number of array elements -

Here is an exchange sort algorithm written in pseudo code: Exchange Sort of Array X[] For I = 0 to (number of array elements - 2), increment by 1 For J = (I + 1) to (number of array elements - 1), increment by 1 If X[I] is greater than X[J] then temp = X[I] X[I] = X[J] X[J] = temp Next J Next I Write a program to define a simple structure for the following information: last name sales (float) Now declare an array of the structure, reserving space for at least 10 elements. The program should request data from the keyboard to populate (put data in) the array. You may use "quit" as a last name code value to indicate that data input is finished. The array should now be sorted so that the element with the highest sales figure is first and the element with the lowest sales figure is last (adapt the exchange above). Output the sorted array to the screen. To compare the entered last name to "quit" do the following: #include in your program: if( strcmp( record field, "quit" ) == 0 ) break; where record field is the name of your last name string (example: entry[i].lastname)

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_2

Step: 3

blur-text-image_3

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Does it use a maximum of two typefaces or fonts?

Answered: 1 week ago

Question

Define organisation chart

Answered: 1 week ago

Question

What are the advantages of planning ?

Answered: 1 week ago

Question

Explain the factors that determine the degree of decentralisation

Answered: 1 week ago

Question

What Is acidity?

Answered: 1 week ago

Question

Explain the principles of delegation

Answered: 1 week ago