Computing.Net > Forums > Programming > C++ array help needed

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

C++ array help needed

Reply to Message Icon

Name: Karsten
Date: February 10, 2003 at 23:10:22 Pacific
OS: Win 98 + WinXP
CPU/Ram: 800MHz 256 SDram
Comment:

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.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Urgent: need help with c+... New to C



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: C++ array help needed

turbo C++ array program need Help!! www.computing.net/answers/programming/turbo-c-array-program-need-help/8615.html

C++ vs Pascal help needed www.computing.net/answers/programming/c-vs-pascal-help-needed/11150.html

c programming help needed www.computing.net/answers/programming/c-programming-help-needed/10441.html