heya, i am working on this program wonderig anyone can help me finish it .
i put in most of the //info on whats suppose to happen but am having trouble figuring out actually how to.
*Program Description: This program is designed to insert numbers into
* an array in ascending order. After the numbers have been inserted
* the user will have the option to display the numbers back to the
* screen in either ascending or descending order. A function will
* be used to insert the number into the correct position in the
* array. Another function will be used to display the numbers back
* to the screen.
*
*BEGIN - Lab 9, Creating my own functions
* Init array count to 0
* Prompt user for first input or QUIT
* WHILE (input is not QUIT)
* Call function to insert the value into the array
* Increment the array count by 1
* IF (the Array is now full)
* Make input = QUIT to exit the loop
* ELSE //the array is not full
* Prompt user for next input or QUIT
* END IF
* END WHILE
* Clear Screen
* Ask user if they want to display in Ascending or Descending order
* Display Title
* IF (User wants ascending order)
* Call display function to display array values in asc order
* ELSE
* Call display function to display array values in desc order
* END IF
*END - Lab 9 - Creating my own functions
*********************************************************************/
#include <iostream>
#include <iomanip>
//local functions stored at bottom of the file
void array_insert(int, int, int[]); //insert 1 value into array
mySwap( Array[count], Array[count+1]); //disp array in asc or desc
using namespace std;
void main()
{
//local constants
const int ARRAY_SIZE = 5;
const int QUIT = -99;
//local variables
Array[ARRAY_SIZE]; //an array to store the integers
int count = 0 ; //a count of #s stored in the array
Num_Input ; //the number input by the user
int Result ; //Result of number for arrary display
/**************************start main program*********************/
//Init array count to 0
for (int count =0; count < ARRAY_SIZE; count++);
//Prompt user for first input or QUIT
cout << "Enter first input or Quit";
cin >> Num_Input;
//WHILE (input is not QUIT)
while (Num_Input =! QUIT)
{
//Call function to insert the value into the array
void array_insert(int, int, int[]);
//Increment the array count by 1
count++;
//IF (the Array is now full)
if (count > ARRAY_SIZE)
{
//Make input = QUIT to exit the loop
Num_Input == QUIT;
//ELSE //the array is not full
else if (count < ARRAY_SIZE)
//Prompt user for next input or QUIT
cout << "Enter number or Quit";
cin >> Num_Input;
}
//END IF
end if
//END WHILE
end while
}
//Clear Screen
system("cls");
//Ask user if they want to display in Ascending or Descending order
cout << "Enter A for Acending order and D for Decending order";
cin >> Result ;
//Display Title
cout << "\n\n\n\n\n";
cout << "The Numbers";
Letter_Code = toupper(Letter_Code);
//IF (User wants ascending order)
if (Result == D)
{
//Call display function to display array values in asc order
mySwap( Array[Count], Array[--Count]);
//ELSE
//Call display function to display array values in desc order
//END IF
} //end main program