Example: Currency Converter
We’re going to develop a simple currency converter, and we’ll use the switch statement to help.
First we declare the rates as constants in our program.
const float dollarRate = 1.3516;
const float yenRate = 163.34;
const float euroRate = 1.2697;
const float sterlingRate = 0.83511;
int main()
{