Search:

Type: Posts; User: kie

Search: Search took 0.00 seconds.

  1. Replies
    6
    Views
    1,315

    like this? do{ printf(" ...

    like this?



    do{
    printf(" *****Menu*****\n\n1. Pounds to Euro\n2. Pounds to USD\n3. Pounds to Chinese Yen\n4. Pounds to Australian dollar\n5. Pounds to Canadian dollar\n\n");
    cin >> menu;...
  2. Replies
    6
    Views
    1,315

    What loop should I use? While? Do While?

    Hey

    I am creating a basic currency converter. I have a simple menu but the problem is there is no error control. Here is the code...



    void menu(void)
    {
    int menu;
    int valid = 0;
  3. Replies
    19
    Views
    2,442

    Could be some errors in my code, i'm very new to...

    Could be some errors in my code, i'm very new to C



    void convert(void)
    {
    char line[80];
    double input; //users input
    char *endptr;
    int valid = 0; //decides whether data is valid, this...
  4. Replies
    19
    Views
    2,442

    it still seems to ignore that and just asks for...

    it still seems to ignore that and just asks for another value stating that invalid data was entered
  5. Replies
    19
    Views
    2,442

    when i compile, i get the error "convert() can...

    when i compile, i get the error "convert() can not return a number"
  6. Replies
    19
    Views
    2,442

    I would like to get around this problem without...

    I would like to get around this problem without changing code if I can, I am using Windows XP MCE
  7. Replies
    19
    Views
    2,442

    hey manutd, I gave that a try and if you type...

    hey manutd, I gave that a try and if you type exit, nothing happens, it just proceeds to the Enter an amount to convert part.

    this is the sort of method I was planning on using. so if anybody...
  8. Replies
    19
    Views
    2,442

    How can I make my app exit...

    Hey, this is probably a simple thing to do. Basically, i'm doing a project for uni work. it is just a simple currency converter. I have managed to get the application so the data is checked and if...
  9. hey, i got it to work using bits from the code by...

    hey, i got it to work using bits from the code by swoopy

    thanks for all your help (and sorry I didn't reply till now)

    :D
  10. i thought it may have been because it's a float....

    i thought it may have been because it's a float.

    how would I use strtod? could you give me some sample code?

    thanks
  11. i am trying the following code within the convert...

    i am trying the following code within the convert function


    void convert(void)
    {
    float input;
    float output;
    printf("Please enter an amount you wish to convert\n");
    scanf("%f", &input);...
  12. so could you help me validate the data to ensure...

    so could you help me validate the data to ensure it is a number?

    i guess an if statement would be best although I don't know what to analyze data obtained from scanf.

    I guess it would be an if...
  13. that has worked perfectly thanks for your help...

    that has worked perfectly

    thanks for your help :D
  14. Displaying numbers to two decimal places using printf

    Hey

    I am currently in uni and I have just started to learn basic C. For a project, I have to make a simple application that can convert GBP into euros (roughly). The problem I have is displaying...
Results 1 to 14 of 14