Need help with C++ program

Discussion in 'Computer Science & Culture' started by seebeegirl38, Jan 19, 2003.

Thread Status:
Not open for further replies.
  1. seebeegirl38 Registered Member

    Messages:
    1
    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?

    Please Register or Log in to view the hidden image!

     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Adam §Þ@ç€ MØnk€¥ Registered Senior Member

    Messages:
    7,415
    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.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
Thread Status:
Not open for further replies.

Share This Page