Purchase Solution

C/C++ Console Program that Uses Arrays

Not what you're looking for?

Ask Custom Question

Create a program in which a user is asked for how many values (s)he wants to enter (maximum 50), then:
Asks for the values and stores them into an array of double.
Sorts the values in ascending order according to the following algorithm, where size is the number of doubles to be sorted:
for i=0..size-2
check all the values between position i and size-1 to find the smallest one
swap the smallest value and the one in position i
Prints the sorted array to the console.

Purchase this Solution

Solution Summary

The solution provides a C/C++ Program that uses arrays.

Solution Preview

I have attached the C++ source code and also the executable. The source code is well-commented and should provide enough explanation. In case it proves insufficient, though, I have explained the code below.

I assume that you are reasonably familiar with basic input and output, so I will not explain those parts. If you find any difficulty, however, I will definitely add more explanation, so please let me know.

The array is stored in the array variable <I>arr</I> and the size of this array is stored in the variable <I>n</I>. After reading ...

Purchase this Solution


Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Javscript Basics

Quiz on basics of javascript programming language.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.