I have completely fixed your code
Code:
#include <iostream.h>
#include <stdlib.h>
#include <string.h >
#include <iomanip.h>
const int MAXCHARS = 16;
const int MAXVALS = 81;
void menu (char);
void assign3 ( int [], int []) ;
int main ()
{
char roman[MAXCHARS];
int tot_value [MAXVALS];
int array3[MAXVALS];
char choice; menu (choice);
// function call void assign (int, int );
return 0;
}
void menu (char choice)
{
do
{
// This is the menu displayed to the screen
cout <<setw(10) << " The KMA Menu " << endl;
cout <<setw(10)<< "============================"<<endl;
cout << "1. Help\n";
cout << "2. Convert to Arabic\n";
cout << "3. Exit\n";
// This read the user selection
cout << " Enter your choice : ";
cin >> choice ;
// This selection acts on the user selection.
switch (choice)
{ case '1' : cout << " Back to Instruction screen\n";
break;
case '2' : cout << " Function process. Convert to arabic\n";
void assign ( int , int ) ; // want to call this function but cant?
break;
case '3' : exit (0);
default : cout <<setw(12) <<" Invalid number. Enter numbers between 1-3"; break;
}
} while (1);
}
int assign (int roman [], int array3 [])
{
int i;
for (i=0; i< MAXCHARS ; i ++ )
cout <<" Enter a roman numeral:";
cin>> roman[i] ;
int j;
for ( j=0 ; j<MAXVALS;j++ )
switch (i)
{
case 'M' : array3[j] = 1000;
case 'D' : array3 [j] = 500;
case 'C' : array3 [j] = 100;
case 'L' : array3 [j] = 50;
case 'X' : array3 [j] = 10;
case 'V' : array3 [j] = 5;
case 'I' : array3 [j] = 1;
default : cout << " Invalid roman numeral. Please re-enter Roman numeral.\n";
break;
return (i);
}
}