I am a student, but not looking for anyone to re-write code. I just need some direction with this error code.
My code:
Code:
/* Currency Converter Program */
/* This program displays 5 currencies and their equivalents to the US dollar */
#include <stdio.h>
#include <ctype.h>
#define Pound .595817;
#define Yen 118.258;
#define Ruble 30.3800;
#define Rand 7.91769;
#define Peso 10.6205;
int main (void)
{
/* Declaration and Initialization of Variables to be Utilized */
float value = 0.00;
float amount = 0.00;
char answer;
/* The follwing 3 lines are static information displayed on the screen to announce the program */
printf("Currency Conversion \n");
printf("Exchange Rates Retrieved On 18 June 2003 12:35 PM EST and Are No Longer Accurate \n\n\n\n");
printf("\t\t\t\t Currency Selection \n\n\n");
printf("\t\t\t 1. United Kingdom Pound \n\n");
printf("\t\t\t 2. Japanese Yen \n\n");
printf("\t\t\t 3. Russian Ruble \n\n");
printf("\t\t\t 4. South African Rand \n\n");
printf("\t\t\t 5. Mexican Peso \n\n\n\n");
{
int choice;
printf("\t\t\t Please select which currency equivalent you would like to see \n");
printf("\t\t\t Or enter q to Quit\n\n");
while ((choice=getchar())!='q')
{
switch(choice)
{
case 1:
printf("\t\t\t Please enter the amount of American money you have \n");
scanf("%f", &amount);
value = amount*Pound
printf("\t\t\t Your American money converts to $%.2f in United Kingdom Pounds. \n\n", value);
printf("--------------------------------------\n\n");
printf(" Please enter a US Dollar Amount:\n\n "); // Enter Dollar Amount
scanf("%f",&amount);
printf("Please make another currency selection, or'q' to quit \n");
break;
case 2:
printf("\t\t\t Please enter the amount of American money you have \n");
scanf("%f", &amount);
value = amount*Yen
printf("\t\t\t Your American money converts to $%.2f in Japanese Yen. \n\n", value);
printf("--------------------------------------\n\n");
printf(" Please enter a US Dollar Amount:\n\n "); // Enter Dollar Amount
scanf("%f",&amount);
printf("Please make another currency selection, or'q' to quit \n");
break;
case 3:
printf("\t\t\t Please enter the amount of American money you have \n");
scanf("%f", &amount);
value = amount*Ruble
printf("\t\t\t Your American money converts to $%.2f in Russian Rubles. \n\n", value);
printf("--------------------------------------\n\n");
printf(" Please enter a US Dollar Amount:\n\n "); // Enter Dollar Amount
scanf("%f",&amount);
printf("Please make another currency selection, or'q' to quit \n");
break;
case 4:
printf("\t\t\t Please enter the amount of American money you have \n");
scanf("%f", &amount);
value = amount*Rand
printf("\t\t\t Your American money converts to $%.2f in South American Rands. \n\n", value);
printf("--------------------------------------\n\n");
printf(" Please enter a US Dollar Amount:\n\n "); // Enter Dollar Amount
scanf("%f",&amount);
printf("Please make another currency selection, or'q' to quit \n");
break;
case 5:
printf("\t\t\t Please enter the amount of American money you have \n");
scanf("%f", &amount);
value = amount*Peso
printf("\t\t\t Your American money converts to $%.2f in Mexican Pesos. \n\n", value);
printf("--------------------------------------\n\n");
printf(" Please enter a US Dollar Amount:\n\n "); // Enter Dollar Amount
scanf("%f",&amount);
printf("Please make another currency selection, or'q' to quit \n");
break;
default :
printf("\t\t\t Invalid Entry");
printf("\t\t\t Please choose another currency or 'q' to quit \n");
break;
}
}
}
getchar();
return 0;
}
App seems to Compile fine, but bombs in Build:
Miracle C Compiler (r3.2), written by bts.
Compiling c:\documents and settings\larcyn\my documents\dad\phoenix material\pos 370\first currency converter\currency3.c
main
2% cg space used
Time taken: 0.12 seconds
Linking object c:\documents and settings\larcyn\my documents\dad\phoenix material\pos 370\first currency converter\currency3.obj,,c:\documents and settings\larcyn\my documents\dad\phoenix material\pos 370\first currency converter\currency3.map,c:\Program Files\Miracle C\ccl.lib ;
Linker Error (Severity 8)
Destination string too small (256 bytes) to hold:
"c:\documents and settings\larcyn\my documents\dad\phoenix material\pos 370\first currency converter\currency3.obj,,c:\documents and settings\larcyn\my documents\dad\phoenix material\pos 370\first currency converter\currency3.map,c:\Program Files\Miracle C\ccl.lib ;" (265 bytes)
Build completed
As a result, the app will not execute. I know this post is long, but I wanted to give all pertinent info. Any help and/or advice would be greatly appreciated.
Code tags added by Hammer