Hint
Use switch (or if–else if) to find the price in dinars. The comparison with the other two prices can be written generally: if the price is greater than both others – the most expensive, if it is smaller than both – the cheapest, otherwise the middle one.
Note: the exchange rate is not given in the original PDF; here 117 dinars for 1 € is used.
Solution (C++)
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
const double RATE = 117.0; // dinars for 1 euro
int p1 = 48000, p2 = 42000, p3 = 58000;
int choice, price;
cin >> choice;
switch (choice) {
case 1: price = p1; break;
case 2: price = p2; break;
case 3: price = p3; break;
default:
cout << "Wrong choice" << endl;
return 0;
}
cout << fixed << setprecision(2) << "Price: " << price / RATE << " EUR" << endl;
int highest = max(p1, max(p2, p3));
int lowest = min(p1, min(p2, p3));
if (price == highest)
cout << "The most expensive" << endl;
else if (price == lowest)
cout << "The cheapest" << endl;
else
cout << "Middle price" << endl;
return 0;
}