Hello,
I am currently trying to teach myself a bit of C++ through programming some simple apps and now I am stuck on two multi-dimensional arrays. This will later become a simple win32 based currency conversion program and I just dont yet know enough about arrays to make it work without hard-coding it (I want to keep the program flexible so hard-coding the calculations is not an option ;p)
Here is what I have so far:
#include
#include
using namespace std;
char currency[][20] = {{"USD","HKD","TB"}{"USD","HKD","TB"}};
double convert[][20] = {{1,5,42.86}{1,5,42.86}};
char displayscreen(char, double);
{
char clearscreen(char);
{
cout(32,"\n");
}
char menu(char);
{
cout "Please Select an Operation:"
"\t\tA: Currency Conversion"
"\t\tB: Add Currency"
"\t\tC: Update exchange rates" endl;
cin;
}
char menuchoice(char);
{
switch (menu);
{
case 'a':
case 'A':
convert();
break;
case 'b':
case 'B':
addcurrency();
break;
case 'c':
case 'C':
upchange();
break;
}
}
double convert(double);
{
cout "From which currency would you like to convert" endl;
cin;
cout "into what currency would you like to convert:" endl;
cin;
This is still a testing version so please dont worry about possible coding errors as I will correct the test once i finished all functions.
What I need the program to do for the conversion fuction is to take a keyboard input from the user and compare the char value with the values in the currency array. both arrays are ordered in the same way so that than the currency array has to parse the row/column value to the conversion array to get the exchange rate for the actual calculation. But as I said before I have absolutly no clue how to put this into code so please help if you can.
PS: Sorry for the length of this thread.