Write a program that sorts a list of 4 different values integer

Your main() function will call an input function (to input the numbers), a sorting function (to sort the numbers), and output function (to display the results sorted numbers).  Accordingly passing any values as needed between all functions.  

 

Write one input function to input one number, returning that value via the return statement to the calling function.  You will need to call this function 4 times to get all 4 values. (no reference parameters, pass by value parameters are okay, int function type).

 

Write a sort function that sorts the 4 numbers from least to greatest.  You may want to also use the swap function at the end of 9/16/2015 lecture to help. (must use reference parameters, no pass by value parameters, void function type)

 

Write an output function to display the numbers sorted.  (pasa by value parameters, void function type)

 

Example program run:


This program will sort four numbers, from smallest value to the largest.  When prompted, please enter four numbers.

 

Please Enter Number 1: 44

Please Enter Number 2: 33

Please Enter Number 3: 22

Please Enter Number 4: 11

 

The Numbers Ordered: 11, 22, 33, 44.


Grading criteria: 20 pts.

   no global variables

   program must use a function with reference parameters,

   program must use a function that returns a value with a return statement

   program must be indented correctly,

   use meaningful variable and function names,

   produce correct output,

   use comments at beginning,

   use comments for each program component,

   use comments for each function

   print user instructions out

   use comments throughout to document what is happening.

Export to portfolio

Submission status

Submission status No attempt
Grading status Not graded
Due date Thursday, September 24, 2015, 11:55 PM
Time remaining 7 hours 54 mins
Last modified Thursday, September 24, 2015, 2:59 PM
Submission comments







Calculate Your Essay Price
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 10% with the coupon code: best10