#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Quality of Capital Calculator */
int main()
{/* Gold Price (Debt indicator)*/
/*Currency Conversion*/
float USD=1;
float EU=73 * 0.01; /*Euro*/
float AUD=97 * 0.01; /*Australian Dollar*/
float BRZ=1757 * 0.01; /*Brazilian Real*/
float CAN=101 * 0.01; /* Canadian Dollar */
float CNY=635 * 0.01; /*Chineses Yuan*/
float HKD=777 * 0.01; /*Hong Kong Dollar*/
float INR=4928 * 0.01; /* Indian Rupee*/
float BP=62 * 0.01; /*British Pound*/
float RUB=3092 * 0.01; /*Russian Ruble*/
float CHF=89 * 0.01; /*Swiss Franc*/
/*User Input */
/*User Selection*/
char USD1 [3]=("USD");
char usd [3]=("usd");
char EU1 [3]=("EU");
char eu [3]=("eu");
char AUD1 [3]=("AUD");
char aud [3]=("aud");
char BRZ1 [3]=("BRZ");
char brz [3]=("brz");
char CAN1[3]=("CAN");
char can[3]=("can");
char CNY1[3]=("CNY");
char cny[3]=("cny");
char HKD1[3]=("HKD");
char hkd[3]=("hkd");
char INR1[3]=("INR");
char inr[3]=("inr");
char BP1[2]=("BP");
char bp[2]=("bp");
char RUB1[3]=("RUB");
char rub[3]=("rub");
char CHF1[3]=("CHF");
char chf[3]=("chf");
char gold [10];
/* used to convert curr and hkd into number values using strcmp */
float input1;
float input2;
float input3;
float input4;
float input5;
float input6;
float input7;
float input8;
float input9;
float input10;
float input11;
float input12;
float input13;
float input14;
float input15;
float input16;
float input17;
float input18;
float input19;
float input20;
float input21;
float input22;
/*storage for gold price and default currency*/
float gold1;
float curr1; /* currency value for converting to gold */
char curr [10]; /*Currency Input*/
printf("Please enter one of the following currencies: USD, EU, AUD, BRZ (Brazilian Real), CAN (Canadian Dollar), CNY (Yuan), HKD (Hong Kong Dollar, INR (Indian Rupee), BP (British Pound, RUB (Russian Ruble),or CHF (Swiss Franc.\n");
gets(curr);
/*input check*/
input1=strcmp(curr,hkd);
if (input1=='0')
{
printf("Hello Test HK.\n");
curr1=HKD;
};
input2=strcmp(curr,HKD1);
if (input2=='0')
{
printf("Hello Test HK.\n");
curr1=HKD;
};
input3=strcmp(curr,BP1);
if (input3=='0')
{
printf("Hello Test BP.\n");
curr1=BP;
};
input4=strcmp(curr,bp);
if (input4=='0')
{
printf("Hello Test BP.\n");
curr1=BP;
};
input5=strcmp(curr,EU1);
if (input5=='0')
{
printf("Hello Test EU.\n");
curr1=EU;
};
input6=strcmp(curr,eu);
if (input6=='0')
{
printf("Hello Test EU.\n");
curr1=EU;
};
input7=strcmp(curr,RUB1);
if (input7=='0')
{
printf("Hello Test RUB.\n");
curr1=RUB;
};
input8=strcmp(curr,rub);
if (input8=='0')
{
printf("Hello Test rub.\n");
curr1=RUB;
};
input9=strcmp(curr,AUD1);
if (input9=='0')
{
printf("Hello Test AUD.\n");
curr1=AUD;
};
input10=strcmp(curr,aud);
if (input10=='0')
{
printf("Hello Test AUD.\n");
curr1=AUD;
};
input11=strcmp(curr,INR1);
if (input11=='0')
{
printf("Hello Test INR.\n");
curr1=INR;
};
input12=strcmp(curr,inr);
if (input12=='0')
{
printf("Hello Test INR.\n");
curr1=INR;
};
input13=strcmp(curr,BRZ1);
if (input13=='0')
{
printf("Hello Test BRZ.\n");
curr1=BRZ;
};
input14=strcmp(curr,brz);
if (input14=='0')
{
printf("Hello Test Brz.\n");
curr1=BRZ;
};
input15=strcmp(curr,CAN1);
if (input15=='0')
{
printf("Hello Test CAN.\n");
curr1=CAN;
};
input16=strcmp(curr,can);
if (input16=='0')
{
printf("Hello Test CAN.\n");
curr1=CAN;
};
input17=strcmp(curr,CNY1);
if (input17=='0')
{
printf("Hello Test CNY.\n");
curr1=CNY;
};
input18=strcmp(curr,cny);
if (input18=='0')
{
printf("Hello Test CNY.\n");
curr1=CNY;
};
input19=strcmp(curr,CHF1);
if (input19=='0')
{
printf("Hello Test CHF.\n");
curr1=CHF;
};
input20=strcmp(curr,chf);
if (input20=='0')
{
printf("Hello Test CHF.\n");
curr1=CHF;
};
input21=strcmp(curr,USD1);
if (input21=='0')
{
printf("Hello Test USD.\n");
curr1=USD;
};
input22=strcmp(curr,usd);
if (input22=='0')
{
printf("Hello Test USD.\n");
curr1=USD;
};
printf("The conversion rate is: %f .\n" ,curr1);
return (0);
};
Hi. I have been trying to work on his one part of a program of mine, and up to this point it has gone pretty well. But every time I have tried to run this program, I get a #QNANO error. I made sure all my variables for the currencies were floats, but it still is not working. What is wrong with this. I have rechecked everything and everything seems ok. ThanksvivoOP
#1
