I am learning c++ and have learned and understood just the VERY basics, but now I am in need of some help.
I compiler I use is microsoft visual studio 2012
I need some help with the following. I just cant seem to get a good starting off point.
Using the practice principles of Function Prototypes, Function Declaration, Function Definition, Function Calls, Value Parameters, Reference Parameters and Decision Statements, I need to
Create 3 functions (areSorted, mySwap and mySort) and test that they work by creating a demonstration program (as shown in the Output Layout section below).
The areSorted function should accept in the values of 2 integers and test if they are in ascending order.
The mySwap function should accept in and swap the values of 2 integer parameters.
The mySort function should accept in and sort the values of 2 integer parameters in ascending order.
The output layout being: Please enter a number (0 to 99): 73
Please enter a number (0 to 99): 42
Those 2 numbers are already in ascending order: 42 73
or
Those 2 numbers sorted in ascending order are: 42 73
I begin with
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#include <iostream>
using namespace std;
int main(void)
{
int a;
int b;
cout<< "please enter a number (0-99): ";
cin>> a;
if(aresorted (a,b));
return EXIT_SUCCESS;
}
|
Not very far, but like I said I am stumped. Any help to lead me in the right direction would be appreciated.
Thank you!