seebeegirl38
01-18-03, 07:49 PM
Recently I enrolled back in school, the course I'm taking is C++ which I don't really understand. The thing is that I need to create a program that convert currency for five different contries into USA Dollar and I have NO IDEA how to even start this. My Instructor at school do no explain much and I have ask him for his help hopeplesly. Could you guys help?:confused:
I really wish I could help, but I'm only just getting into C++. I can do the C for you, if that is any help at all.
The converter function is passed the character code of the country you wish to convert from, and the amount of money as a floating point number.
float converter(char type, float amount)
{
switch(type)
{
case germany:
usd = amount * 1.1;
break;
case austria:
usd = amount * 1.2;
break;
case france:
usd = amount * 1.3;
break;
case sweden:
usd = amount * 1.4;
break;
case poland:
usd = amount * 1.5;
break;
default:
usd = amount * 1.0;
break;
}
return usd;
}
Use whatever numbers accurately represent the current conversion rate sfor then countries you choose.
Well, something like that, I think. Might be totally different in C++, sorry.