how to output the euro symbol

here is the code i have so far, basically you have ti enter a price in pounds and it will convert it to euros. i have got the conversion working i am just unsure how to get the euro symbol for the out put. any help would be much appreciated.

#include <iostream>
#include <iomanip>
#include <cassert>
using namespace std;

int main()
{
char answer;
float sumInEuros;
int numberOfPrices;
answer = 'Y';
numberOfPrices = 0;
sumInEuros = 0;
void processAPrice(float&, int);
void displayFinalData(float, int);
while ((answer == 'Y') || (answer == 'y'))

{
processAPrice(sumInEuros, numberOfPrices);
numberOfPrices = numberOfPrices + 1;
cout << (" Continue (Y/N)?");
cin >> (answer);
}

if (numberOfPrices > 0)
{
displayFinalData(sumInEuros, numberOfPrices);
}

}

void processAPrice(float& sumInE, int numOfPrices)
{
float priceInPounds, priceInEuros;
const float& conversionRate = 0.82;
float getPriceInPounds(float&);
float convertPriceIntoEuros(float, float, float&);
void showPriceInEuros(float, float);
float calculateSum(float&, float);
getPriceInPounds(priceInPounds);
convertPriceIntoEuros(priceInPounds, conversionRate, priceInEuros);
showPriceInEuros(priceInPounds, priceInEuros);
calculateSum(sumInE, numOfPrices);

}

float getPriceInPounds(float& priceInP)
{
cout << ("Enter a price (in pounds): £");
cin >> (priceInP);
return(priceInP);
}

float convertPriceIntoEuros(float priceInP, float convRate, float& priceInE)
{
priceInE = priceInP / convRate;
return (priceInE);
}

void showPriceInEuros(float priceInP, float priceInE)
{
cout << ("The euro value of £", priceInP, "is €", priceInE);
}

float calculateSum(float& sumInE, float priceInE)
{
sumInE = sumInE + priceInE;
return(sumInE);
}

void displayFinalData(float sumInE, int numOfPrices)
{
cout << ("The total sum is: ", sumInE, "€");
cout << ("The average is: ", sumInE / numOfPrices);
}
Not sure if this is the best way but it is in the ANSII code so you can store the number and set it to a char value like
1
2
3
4
5
6
7
{
	char A;
	int B = 146;
	A = B;
	cout << A;
	return 0;
}
this is not for the pound sign it is for Æ but same principle
1
2
char euro = 146;
cout << euro;
Topic archived. No new replies allowed.