ok now i'm here can anyone help me by showing me maybe what i should put into the functions themselves? i'm kinda stuck, help would be appreciated thanks,
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define SIZE 8
void printMenu();
void multiply(int [], int);
void divide(int [], int);
void add(int [], int);
void sub(int [], int);
void copy(int [], int);
void remainder(int [], int);
void swap(int [], int);
void drop(int [], int);
void clear(int [], int);
int main()
{
int i=0, j=0;
char choice[80];
int array[SIZE];
for(i=0;i<SIZE;i++)
{
printf( "%d Enter a number: ", i );
scanf( "%d", &array[i] );
}
printf( "\nThe Contents of the Array are:\n " );
for(j=0;j<SIZE;j++)
{
printf( "%4d", array[j] );
}
printMenu();
printf( "Enter a Choice: " );
scanf( "%s", choice );
if((choice[0] == '1') || (choice[0] == '*'))
{
multiply( array, SIZE );
}
if((choice[0] == '2') || (choice[0] == '/'))
{
divide( array, SIZE );
}
if((choice[0] == '3') || (choice[0] == '+'))
{
add( array, SIZE );
}
if((choice[0] == '4') || (choice[0] == '-'))
{
sub( array, SIZE );
}
if((choice[0] == '5') || (choice[0] == '='))
{
copy( array, SIZE );
}
if((choice[0] == '6') || (choice[0] == '%'))
{
remainder( array, SIZE );
}
if((strcmp(choice, "7") == 0) || (strcmp(choice, "Swap") == 0))
{
swap( array, SIZE );
}
if((strcmp(choice, "8") == 0) || (strcmp(choice, "Drop") == 0))
{
drop( array, SIZE );
}
if((strcmp(choice, "9") == 0) || (strcmp(choice, "Clear") == 0))
{
clear( array, SIZE );
}
if((strcmp(choice, "10") == 0) || (strcmp(choice, "Quit") == 0))
{
exit(0);
}
}
void printMenu()
{
printf( "\n\n ** Menu **\n\n" );
printf( "1. * \n" );
printf( "2. / \n" );
printf( "3. + \n" );
printf( "4. - \n" );
printf( "5. = \n" );
printf( "6. % \n" );
printf( "7. Swap \n" );
printf( "8. Drop \n" );
printf( "9. Clear \n" );
printf( "10. Quit \n\n" );
}
void multiply( int b[], int size )
{
int n;
for(n=0; n < size; n++)
{
if((b[n] == '0') || (n == 7)
{
}
}
}
void divide( int b[], int size )
{
}
void add( int b[], int size )
{
}
void sub( int b[], int size )
{
}
void copy( int b[], int size )
{
}
void remainder( int b[], int size )
{
}
void swap( int b[], int size )
{
}
void drop( int b[], int size )
{
}
void clear( int b[], int size )
{
}