Hi, All! I am learning C++ and new to this forum. I hope we will be all be helpful to each other.
For my questions:
(1)___________________________________________________________________
When I run this program which converts USD to euros/yen depending on the user's choice, it runs properly when I use the inputs like 1y, 1 (return) y, and 1 (return) e, but when I use 1e, the program returns the else statement. Why is that?
Here is my program in int main;
const double ytd=1/360.0, etd=1/1.287;
double d=0;
char c='v';
cout<<"Please enter the amount of USD then the letter 'e' to be converted to euro or"<<
" letter 'y' to be converted to yen.\n";
cin>>d>>c;
switch (c){
case 'y':
cout<<"You have "<<d*ytd<<" yen\n";
break;
case 'e':
cout<<"You have "<<d*etd<<" euros\n";
break;
default:
cout<<"I do not know this currency.\n";
break;
/* ytd=yen to dollars
etd=euro to dollars
d=dollars
c=currency */
______________________________________________________________________
(2)___________________________________________________________________
I am trying to make a C++ program that would arrange three words in alphabetical order. Note that I did one for arranging three integers from least to greatest. Any help?
______________________________________________________________________
(3)___________________________________________________________________
Plus, why when I add/multiply/divide/subtract double numbers and store them into a double variable, it will store them as int?
_____________________________________________________________________
(4)__________________________________________________________________
Is this true?
http://www.gidnetwork.com/b-61.html
____________________________________________________________________
And thanks.