June 18th, 2013, 06:56 AM
Help taking the next step
I am trying to work out how I take the result from the question asked in the below code and then do a calculation I am a bit stuck. I have compiled this and it seems to work
When you run it asks for a corresponding letter to be entered to know which currency you want to convert to US$. you can enter the letter but from there I am a bit stuck.
What I am trying to do is once you have entered the letter it says so you want to convert to x to US$, at an exchange rate of y.
Then it asks you the question how many x's do you want to convert to US$
The user then enters the amount and the answer is returned
I just need to know which step to learn next I am not asking someone to do it for me.
int a =2;
int b =4;
int c =6;
int d =8;
printf("\n Enter the letter1 of the currency you ");
printf("\n want to convert into US$");
printf("\n a = Australian dollars.");
printf("\n b = British Pounds.");
printf("\n c = Japenes yen.");
printf("\n d = Vitnames dollars.");
printf(" Enter amount to convert: ");
June 18th, 2013, 07:19 AM
One way is to write a set of if-else if statements. Another way is to write a switch case statement. Learn how to write switch case statements.