currency conversion

Compiles ok, Builds ok but doesn't produce anything when I execute
Please help
        
#include <stdio.h>    
int main ()
{

         /*Declaring variables for five foreign nations, and there currencies
         for one USdollar and there NASD symbols, which are: */
         /* aud            Austrialia            1.40196  */
         /* cad            Canada             1.2754   */
         /* gpd            Great Britain         0.52434  */
         /* eur             Europe             0.812612 */
         /* mxn            Mexico             11.0425  */
                

// -----------------------------------------------------------------------------------------------------//

          float value, audcur, cadcur, gpdcur, eurcur, mxncur;
         
//------------------------------------------------------------------------------------------------------//

/* Variables for the denominations rate of the foreign currencies */
/* The variable names are representatives of foreign nations*/
     
          char British_unit[]="pounds";
          char Canadian_unit[]= "dollars";
          char European_unit[]= "euros";
          char Australian_unit[]="dollars";
          char Mexican_unit[]="pesos";
         
         
//-----------------------------------------------------------------------------------------------------//
           /*Display the value of the foreign exchange currency to one USdollar*/    
/*----------------------------------------------------------------------------------------------------- */
          scanf("%f ,&value"); /* for one USdollar */
          while (value !=  0.0)
          if(value<0.01&& value>1000.00)
{
      printf("Enter a dollar amount 0.01 to 1000.00 for all listed currencies to one USdollar");  

}else
{  
 
      /*Display report title and date of conversion */

      printf("***********************************************************************\n");
      printf("  Currency Conversion Rates\n");
      printf("    26th October 2004 /n ");
      printf("***********************************************************************\n");
           
/* Display the exchange rates and verify USdollar inputs for Australia, Canada, Great Britain, Europe, Mexico */
  /* Declaring variables for the five foreign nations as audcur, cadcur, gpdcur, eurcur, mxncur */            
 
      printf ("Exchange Rates For US $1.00\n\n");
      printf ("   Country      Rate\n");
      printf ("-------------------------------------------------------------------------------------------------------\n\n");
      printf ("Great Britain: %f%s\n",gpdcur,  British_unit);
      printf ("      Canada:  %f%s\n",cadcur,  Canadian_unit);
      printf ("      Europe:  %f%s\n",eurcur,  European_unit);  
      printf ("   Australia:  %f%s\n",audcur,  Australian_unit);
      printf ("      Mexico:  %f%s\n",mxncur,  Mexican_unit);
      printf(" Foreign currencies verify to one USdollar");
      printf ("The End\n");
      printf("Press Enter to end Program\n");
/*-------------------------------------------------------------------------------------------------------------------*/
}
        scanf("%f ,&value");
lclariusAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lclariusAuthor Commented:
i change if(value <0.01 || value >1000.00)
now i'm getting Miracle C Compiler (r3.2), written by bts.
Compiling C:\Program Files\Miracle C\lisafour.c
main

C:\Program Files\Miracle C\lisafour.c: line 55: Parse Error, expecting `SEP'
'else  {   printf("***********************************************************************\n")'
aborting compile


plesase help me

i'm loosing it :)
#include <stdio.h>    
int main ()
{

         /*Declaring variables for five foreign nations, and there currencies
         for one USdollar and there NASD symbols, which are: */
         /* aud            Austrialia            1.40196  */
         /* cad            Canada             1.2754   */
         /* gpd            Great Britain         0.52434  */
         /* eur             Europe             0.812612 */
         /* mxn            Mexico             11.0425  */
                

// -----------------------------------------------------------------------------------------------------//

          float value, audcur, cadcur, gpdcur, eurcur, mxncur;
         
//------------------------------------------------------------------------------------------------------//

/* Variables for the denominations rate of the foreign currencies */
/* The variable names are representatives of foreign nations*/
     
          char British_unit[]="pounds";
          char Canadian_unit[]= "dollars";
          char European_unit[]= "euros";
          char Australian_unit[]="dollars";
          char Mexican_unit[]="pesos";
         
         
//-----------------------------------------------------------------------------------------------------//
           /*Display the value of the foreign exchange currency to one USdollar*/    
/*----------------------------------------------------------------------------------------------------- */
          scanf("%f ,&value"); /* for one USdollar */
          while (value !=  0.0)
          if(value <0.01 || value >1000.00)
      printf("Enter a dollar amount 0.01 to 1000.00 for all listed currencies to one USdollar");  
}
else
{  
 
      /*Display report title and date of conversion */

      printf("***********************************************************************\n");
      printf("  Currency Conversion Rates\n");
      printf("    26th October 2004 /n ");
      printf("***********************************************************************\n");
           
/* Display the exchange rates and verify USdollar inputs for Australia, Canada, Great Britain, Europe, Mexico */
  /* Declaring variables for the five foreign nations as audcur, cadcur, gpdcur, eurcur, mxncur */            
 
      printf ("Exchange Rates For US $1.00\n\n");
      printf ("   Country      Rate\n");
      printf ("-------------------------------------------------------------------------------------------------------\n\n");
      printf ("Great Britain: %f%s\n",gpdcur,  British_unit);
      printf ("      Canada:  %f%s\n",cadcur,  Canadian_unit);
      printf ("      Europe:  %f%s\n",eurcur,  European_unit);  
      printf ("   Australia:  %f%s\n",audcur,  Australian_unit);
      printf ("      Mexico:  %f%s\n",mxncur,  Mexican_unit);
      printf(" Foreign currencies verify to one USdollar");
      printf ("The End\n");
      printf("Press Enter to end Program\n");
/*-------------------------------------------------------------------------------------------------------------------*/
}
        scanf("%f ,&value");
}
0
lclariusAuthor Commented:
please give me a little help here - i'm getting
Miracle C Compiler (r3.2), written by bts.
line  91: String crosses a line: '%f"value);

C:\Program Files\Miracle C\helloworldlisadclariusweekfour.c: line 36: redeclaration of local
'float audcur = 1.40196'
aborting compile

I need help  

lclarius

/*-------------------------------------------------------------------------------
Purpose: US Dollar Currency Conversion

Version History: // PRO375, UOP //
Name: CurrencyConversionLisaClarius03.c
Number: 4 // Week four //
Date: 09/27/04
Student Programmer: Lisa Clarius
Version: IA Wk 2 // revised for Wk 4//
Purpose: Week Four IA coding
Date Revised: 10/26/04
Revised by: LDC
Instructor: Lon Hosford
-------------------------------------------------------------------------------*/


#include <stdio.h>    
int main ()
{

         /*Declaring variables for five foreign nations, and there currencies
         for one USdollar and there NASD symbols which are: */
         /* aud            Australia      1.40196  */
         /* cad            Canada             1.2754   */
         /* gpd            Great Britain   0.52434  */
         /* eur       Europe             0.812612 */
         /* mxn            Mexico             11.0425  */
                

// -----------------------------------------------------------------------------------------------------//

          float value, audcur, cadcur, gpdcur, eurcur, mxncur;
         
       /* Declaring and initializing currency conversion variables to their value */
      
          float audcur = 1.40196;
          float cadcur = 1.2754;
        float gpdcur = 0.52434;
        float eurcur = 0.812612;
        float mxncur = 11.0425;


         
//------------------------------------------------------------------------------------------------------//

/* Variables for the denominations rate of the foreign currencies */
/* The variable names are representatives of foreign nations*/
     
          char British_unit[]="pounds";
          char Canadian_unit[]= "dollars";
          char European_unit[]= "euros";
          char Australian_unit[]="dollars";
          char Mexican_unit[]="pesos";
         
         
//-----------------------------------------------------------------------------------------------------//
           /*Display the value of the foreign exchange currency to one USdollar*/    
/*----------------------------------------------------------------------------------------------------- */
          scanf("%f ,&value"); /* for one USdollar */
          while(value!=0)  
          if(value<0.01 || value>1000.00)

{
      printf("Enter a dollar amount 0.01 to 1000.00 for all listed currencies to one USdollar");  

}else
{  
 
      /*Display report title and date of conversion */

      printf("***********************************************************************\n");
      printf("  Currency Conversion Rates\n");
      printf("    26th October 2004 /n ");
      printf("***********************************************************************\n");
           
 /* Display the exchange rates and verify USdollar inputs for British, Canadian, European, Australian and Mexican */
 
      printf ("Exchange Rates For US $1.00\n\n");
      printf ("   Country      Rate\n");
      printf ("-------------------------------------------------------------------------------------------------------\n\n");
      printf ("Great Britain: %f%s\n",gpdcur*value,  British_unit);
      printf ("      Canada:  %f%s\n",cadcur*value,  Canadian_unit);  
      printf ("      Europe:  %f%s\n",eurcur*value,  European_unit);    
      printf ("   Australia:  %f%s\n",audcur*value,  Australian_unit);
      printf ("      Mexico:  %f%s\n",mxncur*value,  Mexican_unit);
      printf(" Foreign currencies verify to one USdollar");
      printf ("\n");
      printf("Press Enter to end Program\n");
/*-------------------------------------------------------------------------------------------------------------------*/

scanf('%f"value);
}
0
Farzad AkbarnejadDeveloperCommented:
You used scanf function in wrong format in two places:
at first: scanf("%f ,&value");  
scanf take two or more parameters, change to scanf("%f" ,&value);
next: scanf('%f"value);    change to: scanf("%f" ,&value);

also you define float variables two times. one when in line:

float value, audcur, cadcur, gpdcur, eurcur, mxncur;
         
and other in:

float audcur = 1.40196;
float cadcur = 1.2754;
........
........

I comment first. The second is enough.

also I change the prompt from "Press Enter to End" to "Enter 0 to End" because you wait for 0 to end your loop.

// ==================================================


/*-------------------------------------------------------------------------------
Purpose: US Dollar Currency Conversion

Version History: // PRO375, UOP //
Name: CurrencyConversionLisaClarius03.c
Number: 4 // Week four //
Date: 09/27/04
Student Programmer: Lisa Clarius
Version: IA Wk 2 // revised for Wk 4//
Purpose: Week Four IA coding
Date Revised: 10/26/04
Revised by: LDC
Instructor: Lon Hosford
-------------------------------------------------------------------------------*/


#include <stdio.h>
int main ()
{

         /*Declaring variables for five foreign nations, and there currencies
         for one USdollar and there NASD symbols which are: */
         /* aud          Australia     1.40196  */
         /* cad          Canada           1.2754   */
         /* gpd          Great Britain   0.52434  */
         /* eur      Europe           0.812612 */
         /* mxn          Mexico           11.0425  */


// -----------------------------------------------------------------------------------------------------//

            // float value, audcur, cadcur, gpdcur, eurcur, mxncur;

       /* Declaring and initializing currency conversion variables to their value */

            float audcur = 1.40196;
            float cadcur = 1.2754;
            float gpdcur = 0.52434;
            float eurcur = 0.812612;
            float mxncur = 11.0425;

            float value;

//------------------------------------------------------------------------------------------------------//

/* Variables for the denominations rate of the foreign currencies */
/* The variable names are representatives of foreign nations*/

            char British_unit[]="pounds";
            char Canadian_unit[]= "dollars";
            char European_unit[]= "euros";
            char Australian_unit[]="dollars";
            char Mexican_unit[]="pesos";


//-----------------------------------------------------------------------------------------------------//
          /*Display the value of the foreign exchange currency to one USdollar*/
/*----------------------------------------------------------------------------------------------------- */
            scanf("%f" ,&value); /* for one USdollar */
            while(value!=0)
                  if(value<0.01 || value>1000.00)
                  {
                        printf("Enter a dollar amount 0.01 to 1000.00 for all listed currencies to one USdollar");
                  } else {

                        /*Display report title and date of conversion */

                        printf("***********************************************************************\n");
                        printf("  Currency Conversion Rates\n");
                        printf("    26th October 2004 /n ");
                        printf("***********************************************************************\n");

            /* Display the exchange rates and verify USdollar inputs for British, Canadian, European, Australian and Mexican */

                        printf ("Exchange Rates For US $1.00\n\n");
                        printf ("   Country      Rate\n");
                        printf ("-------------------------------------------------------------------------------------------------------\n\n");
                        printf ("Great Britain: %f%s\n",gpdcur*value,  British_unit);
                        printf ("      Canada:  %f%s\n",cadcur*value,  Canadian_unit);
                        printf ("      Europe:  %f%s\n",eurcur*value,  European_unit);
                        printf ("   Australia:  %f%s\n",audcur*value,  Australian_unit);
                        printf ("      Mexico:  %f%s\n",mxncur*value,  Mexican_unit);
                        printf(" Foreign currencies verify to one USdollar");
                        printf ("\n");
                        printf("Enter 0 to end Program\n");
                  /*-------------------------------------------------------------------------------------------------------------------*/

                  scanf("%f", &value);
            }
}

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

lclariusAuthor Commented:
will do --- will let you know how it works out --- these are stupid  mistakes ........... hey with every mistake i'm learning
thanks million lclarius
0
lclariusAuthor Commented:


I'm getting an error on value ......... this is a nightmare for real

Miracle C Compiler (r3.2), written by bts.

C:\Program Files\Miracle C\helloworldlisadclariusweekfour.c: line 59: variable 'value' not found
'("%f",&value)'
aborting compile

#include <stdio.h>    
int main ()
{

         /*Declaring variables for five foreign nations, and there currencies
         for one USdollar and there NASD symbols which are: */
         /* aud            Australia      1.40196  */
         /* cad            Canada             1.2754   */
         /* gpd            Great Britain   0.52434  */
         /* eur       Europe             0.812612 */
         /* mxn            Mexico             11.0425  */
                

// -----------------------------------------------------------------------------------------------------//

        // Display  audcur, cadcur, gpdcur, eurcur, mxncur//
         
       /* Declaring and Intializing currency conversion variables to their values */
      
          float audcur = 1.40196;
          float cadcur = 1.2754;
        float gpdcur = 0.52434;
        float eurcur = 0.812612;
        float mxncur = 11.0425;


         
//------------------------------------------------------------------------------------------------------//

/* Variables for the denominations rate of the foreign currencies */
/* The variable names are representatives of foreign nations*/
     
          char British_unit[]="pounds";
          char Canadian_unit[]= "dollars";
          char European_unit[]= "euros";
          char Australian_unit[]="dollars";
          char Mexican_unit[]="pesos";
         
         
//-----------------------------------------------------------------------------------------------------//
           /*Display the value of the foreign exchange currency to one USdollar*/    
/*----------------------------------------------------------------------------------------------------- */
          scanf("%f" ,&value); /* for one USdollar */
          while(value!=0)  
          if(value<0.01 || value>1000.00)

{
      printf("Enter a dollar amount 0.01 to 1000.00 for all listed currencies to one USdollar");  

}else
{  
 
      /*Display report title and date of conversion */

      printf("***********************************************************************\n");
      printf("  Currency Conversion Rates\n");
      printf("    26th October 2004 /n ");
      printf("***********************************************************************\n");
           
 /* Display the exchange rates and verify USdollar inputs for British, Canadian, European, Australian and Mexican */
 
      printf ("Exchange Rates For US $1.00\n\n");
      printf ("   Country      Rate\n");
      printf ("-------------------------------------------------------------------------------------------------------\n\n");
      printf ("Great Britain: %f%s\n",gpdcur*value,  British_unit);
      printf ("      Canada:  %f%s\n",cadcur*value,  Canadian_unit);  
      printf ("      Europe:  %f%s\n",eurcur*value,  European_unit);    
      printf ("   Australia:  %f%s\n",audcur*value,  Australian_unit);
      printf ("      Mexico:  %f%s\n",mxncur*value,  Mexican_unit);
      printf(" Foreign currencies verify to one USdollar");
      printf ("\n");
      printf("Enter 0 to end \n");
/*-------------------------------------------------------------------------------------------------------------------*/

scanf("%f"value);
}
0
Farzad AkbarnejadDeveloperCommented:
You must declare value also.
Place

float value;

statement where you define other variables in:

 /* Declaring and Intializing currency conversion variables to their values */
     
===>  [add]:  

  float value;

  float audcur = 1.40196;
  float cadcur = 1.2754;
  .....

also you have sybtax error in second scanf too:


scanf("%f"value);     [Change to ==>]     scanf("%f", value);


//-------------------

-FA



0
lclariusAuthor Commented:
I know i must sound so stupid here, I'm learning please don't get upset ....... sorry just learning
i'm getting this now Miracle C Compiler (r3.2), written by bts.

(null) Parse Error, expecting `'}''
''
aborting compile

#include <stdio.h>    
int main ()
{



         /*Declaring variables for five foreign nations, and there currencies
         for one USdollar and there NASD symbols which are: */
         /* aud            Australia      1.40196  */
         /* cad            Canada             1.2754   */
         /* gpd            Great Britain   0.52434  */
         /* eur       Europe             0.812612 */
         /* mxn            Mexico             11.0425  */
                

// -----------------------------------------------------------------------------------------------------//

        // Display  audcur, cadcur, gpdcur, eurcur, mxncur//
         
       /* Declaring and Intializing currency conversion variables to their values */

     float value;            float audcur = 1.40196;
                      float cadcur = 1.2754;
                    float gpdcur = 0.52434;
                    float eurcur = 0.812612;
                    float mxncur = 11.0425;
     
//------------------------------------------------------------------------------------------------------//

/* Variables for the denominations rate of the foreign currencies */
/* The variable names are representatives of foreign nations*/
     
                      char British_unit[]="pounds";
                     char Canadian_unit[]= "dollars";
                      char European_unit[]= "euros";
                      char Australian_unit[]="dollars";
                      char Mexican_unit[]="pesos";
         
         
//-----------------------------------------------------------------------------------------------------//
           /* Declare the foreign exchange currency value to one USdollar */    
/*----------------------------------------------------------------------------------------------------- */
          scanf("%f",value); /* for one USdollar */  
          while (value !=  0.0)
          if(value<0.01 || value>1000.00)

{
      printf("Enter a dollar amount 0.01 to 1000.00 for all listed currencies to one USdollar");  

}else
{  
 
      /*Display report title and date of conversion */

      printf("***********************************************************************\n");
      printf("  Currency Conversion Rates\n");
      printf("    26th October 2004 /n ");
      printf("***********************************************************************\n");
           
 /* Display the exchange rates and verify USdollar inputs for British, Canadian, European, Australian and Mexican */
 
      printf ("Exchange Rates For US $1.00\n\n");
      printf ("   Country      Rate\n");
      printf ("-------------------------------------------------------------------------------------------------------\n\n");
      printf ("Great Britain: %f%s\n",gpdcur*value,  British_unit);
      printf ("      Canada:  %f%s\n",cadcur*value,  Canadian_unit);  
      printf ("      Europe:  %f%s\n",eurcur*value,  European_unit);    
      printf ("   Australia:  %f%s\n",audcur*value,  Australian_unit);
      printf ("      Mexico:  %f%s\n",mxncur*value,  Mexican_unit);
      printf(" Foreign currencies verify to one USdollar");
      printf ("\n");
      printf("Enter 0 to end \n");
/*-------------------------------------------------------------------------------------------------------------------*/

 scanf("%f", value);

}
0
lclariusAuthor Commented:
please come back to me soon - i need help lclarius
0
Farzad AkbarnejadDeveloperCommented:
add close brace  (  } )  in the end of your program after second scanf statement:

     printf("Enter 0 to end \n");
/*-------------------------------------------------------------------------------------------------------------------*/

   scanf("%f", value);
  }      // <===               * This is for closing else section of if - else block
}


If your are using indent style you can reduce these type mistakes:


main()
{
    ....
    ....
    while (   )
        if  (  )
        {
             ....
             ....
        } else {
             ....
             ....
        }   // end of if block

}  // For end of main



-FA    
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lclariusAuthor Commented:
thank you for coming back to me ... will implement changes and compile to see if all is ok
will let you know - your the greates FA :))))
0
lclariusAuthor Commented:
I could kiss you thank you so much -------- your a life saver :)))))))))))
 Miracle C Compiler (r3.2), written by bts.

Miracle C Compiler (r3.2), written by bts.
Linking object C:\Program Files\Miracle C\helloworldlisadclariusweekfour.obj,,C:\Program Files\Miracle C\helloworldlisadclariusweekfour.map,c:\Program Files\Miracle C\ccl.lib <exe.file>;
file 'c:\program files\miracle c\ccl.lib <exe.file>' failed to open for read in linker

Build completed


We are in business now ....... Many thanks and may you have a blessed night :)
0
Farzad AkbarnejadDeveloperCommented:
Glad to help you :-)

Thanks
-FA
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.