Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int main()
- {
- float sumInEuros, numberOfPrices, answer;
- void processAPrice();
- void produceFinalData();
- numberOfPrices = 0;
- sumInEuros = 0;
- answer = 'Y';
- while (answer = 'Y')
- {
- processAPrice(sumInEuros);
- numberOfPrices = (numberOfPrices +1);
- cout << ("Continue (Y/N)?");
- cin >> answer;
- }
- produceFinalData(float sumInEuros, numberOfPrices);
- }
- void processAPrice(float sum)
- {
- float priceInPounds, priceInEuros;
- void getPriceInPounds();
- void convertPriceIntoEuros();
- void showPriceInEuros();
- void calculateSum();
- getPriceInPounds(priceInPounds);
- convertPriceIntoEuros(priceInPounds, priceInEuros);
- showPriceInEuros(priceInPounds, priceInEuros);
- calculateSum(priceInEuros, sum);
- }
- void getPriceInPounds(float inPounds)
- {
- cout << ("Enter a price in pounds: £");
- cin >> inPounds;
- }
- void convertPriceIntoEuros(float pInPounds, float pInEuros)
- {
- const float conversionRate = 0.93;
- pInEuros = (pInPounds / conversionRate);
- }
- void showPriceInEuros(float inPounds, float inEuros)
- {
- cout << ("The euro value of £ ") << inPounds << (" is € ") << inEuros;
- }
- void calculateSum(pE, sE)
- {
- sE = (sE + pE)
- }
- void produceFinalData( float sumOfPrices, float numOfPrices)
- {
- cout << ("The total sum is: ") << sumOfPrices << (" €");
- cout << ("The average is: ") << (sumOfPrices / numOfPrices);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement