مساء اللخير
عندي مساله حاوللت احلهاا ولكن فيه شي عقدني
ممكن تسااعدوني
هذا السوال
Write a C++ program that store the following list of countries and currencies in a 2-D array of strings: {{KSA, Riyal} , {UAE, Dirham} , {UK, Pound},{USA, Dollar}}.
Then ask the user about his choice of eitherhewant to:
- Enter country name to know its currency
- Enter currency name to know which country it belongs to
In either choices, the program should output the correspondent information according to the inputted one. If the program does not find the inputted country or currency, it print "Sorry, Not Found" error message. Here are some run samples,
وهذه محااولاتي
#include
<iostream>
#include
<string>
using
namespace std;
string a[4][2]={{
"KSA", "Riyal"} , {"UAE", "Dirham"} , {"UK", "Pound"},{"USA", "Dollar"}};
string d;
void
countries()
{
for (int i=0;i<4;i++)
return
;
}
void
currencies()
{
cout<<
" ";
return
;
}
int
main()
{
int x;
cout<<
"Hi"<<endl;
cout<<
"Coose what you want to know "<<endl;
cout<<
"1. currency name based on country name? \n2. country name based on currency name?"<<endl;
cin>>x;
switch (x)
{
case 1: countries();
break;
case 2: currencies();
break;
default : cout<<"Erorr"<<endl;
}
system (
"pause");
return 0;
}