Make a program that asks the user for the size of an array

Assignment Help Business Management
Reference no: EM132399137

Make a program that asks the user for the size of an array, then reads a number of integer values (from user input) into the array. No points for that part - it's pretty much the same code as you need for problem (3). Make a function to print out the array and call it to print the array out after all values are read in - basically use your code from question (2), reused. Make a function to implement Insertion Sort and run it on the data array to sort the array (3 pts). Make another function to implement Selection Sort and run it on the data array (3 pts).  Print out the array before and after each sort. NOTE: sort the items in DESCENDING ORDER. Biggest first, smallest last. The function prototypes are:

void show_array (int data[ ], int n);

void InsertionSort (int data[ ], int n);

void SelectionSort (int data[ ], int n);

where data[] is the array and n is the size of the array.

If you implement both sort routines you will need to make a copy of the original unsorted array before using the first sort, or else the second sort will be working on a sorted version of the array.

As with all extra credit problems, work on your own. If code is shared between two students, both receive zero points on the problem. If code comes from some other source (the web, for example) that is plagiarism and the student will receive zero points for the whole lab (not just this problem).

Reference no: EM132399137

Questions Cloud

Setup the permissions for file : Suppose there exists an executable file N.exe that is owned by the root. How would you setup the permissions for this file
How users will perform specific tasks using an application : A use case is defined as a description of how users will perform specific tasks using an application. What business problem did the company face?
Will you hire people who are better than you are : In the future, if you will be a CEO of a software company, will you hire people who are better than you are? How will you feel sitting in a meeting
How to properly deallocate an object allocated : Then please give instructions how to properly deallocate an object allocated on Free-Store. Please use a code example to demonstrate.
Make a program that asks the user for the size of an array : Make a program that asks the user for the size of an array, then reads a number of integer values (from user input) into the array. No points for that part
Bringing certain kinds of devices into the workplace : Some organizations prohibit workers from bringing certain kinds of devices into the workplace, such as cameras, cell phones, and USB drives.
Three hardware priorities for a cad workstation : Three hardware priorities for a CAD workstation are a multicore processor, maximum RAM, and a high-end video card.
Bytes of byte-addressable main memory : Suppose a computer using fully associative cache has 264 bytes of byte-addressable main memory and a cache of 128 blocks, where each cache block contains
Discuss your organization use of the monte carlo method : Discuss?your organization's use of the Monte Carlo method or the method used in its place

Reviews

Write a Review

Business Management Questions & Answers

  Threat of new competitors

When a company is profitable, there is always the threat of new competitors. The market structure may deter new entrants. For example, if there is a significant investment required to enter the market, competition may be minimal.

  Logistics management-system utilization

What is a system modification, and what requirements are affected when a modification is made?

  Manufacturing of an electronics companyassume you have the

manufacturing of an electronics companyassume you have the role of top management at a major global electronics company

  Is the patients dissatisfaction with the clinic justified

Develop a process map for the medical clinic that shows the times of the various activities. Is the patients’ dissatisfaction with the clinic justified?

  Fiscal policy-criticisms and complications

Complete the following table by indicating whether each scenario is an example of a recognition lag, implementation lag, or impact lag.

  Why was the case brought

Analysis of The Supreme Court of the United States case of Ledbetter v. Goodyear Tire & Rubber Company

  Competitive edge against emerging markets

Emerging markets in other developing countries are gaining global influence and global power. In 20 years, these countries will be the dominant force in global economics. Will developed countries be able to maintain their competitive edge against ..

  Essentials of marketing research

CASE STUDY: NEW SHOE COMPANY (adopted from Proctor, T. (2005) Essentials of Marketing Research), Pearson Education. The New Shoe Company

  Prolonging an economic downturn

Why may austerity be associated with prolonging an economic downturn?

  A crisis for the catholic church

The Protestant Reformation, which began in 1517, did significant damage to the power and influence of the Catholic Church. Prior to the Protestant Reformation.

  Discuss what wireless technologies you have used

Discuss what wireless technologies you have used. Do you have wireless networks at home? If so, what standards does it use?

  Is internal or external communication formal or informal

Is this internal or external communication? Formal or informal? Why?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd