Write C++ program to currency exchange, which is the process that allows customers to exchange one currency for another. The program will include decision-making statements, loops, arrays, file I/O, string, and functions. You should be following below details: • As you might know, currency rates are influenced by several factors such a country's economic performance. Thus, it is better to get the up to-date currency rates from an external source as it is easier to update. You should read the data from the file "ExchangeRate.txt". "ExchangeRate.txt" file contain: 1.00 SAR 0.08 KWD 1.00 SAR 0.97 QAR 1.00 SAR 0.98 AED 1.00 SAR 0.10 BHD 1.00 SAR 0.10 OMR 1.00 QAR 0.08 KWD 1.00 QAR 1.01 AED 1.00 QAR 0.10 BHD 1.00 QAR 0.11 OMR 1.00 KWD 12.00 AED 1.00 KWD 1.23 BHD 1.00 KWD 1.26 OMR 1.00 AED 0.10 BHD 1.00 AED 0.10 OMR 1.00 BHD 1.02 OMR The program should print the available currencies for exchange which are: o SAR --> Saudi Arabia Riyal o KWD --> Kuwaiti Dinar o QAR --> Qatar Riyal o AED --> United Arab Emirates Dirham o BHD --> Bahraini Dinar o OMR --> Omani Rial Please make sure the user only enters the correct currency abbreviations (e.g., SAR). Otherwise, ask them to re-enter the currency until they get it right. For usability reasons, the user can enter their currencies in capital or small letters (i.e., SAR, SR, Sar, and SAR are all correct inputs). You are expected to use at least one void function and one value returning function. Feel free to use them for any part of your program. • The data file shows the currency exchange between two currencies. For example, if the file shows "1.00 KWD= 12.27 SAR", you can use this line to exchange KWD to SAR and also exchange SAR to KWD

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write C++ program to currency exchange, which is the process that allows customers to exchange one currency for another. The program will include decision-making statements, loops, arrays, file I/O, string, and functions.

You should be following below details:

  • As you might know, currency rates are influenced by several factors such a country's
    economic performance. Thus, it is better to get the up to-date currency rates from an
    external source as it is easier to update. You should read the data from the file “ExchangeRate.txt”.
  • “ExchangeRate.txt” file contain:

1.00 SAR 0.08 KWD

1.00 SAR 0.97 QAR

1.00 SAR 0.98 AED

1.00 SAR 0.10 BHD

1.00 SAR 0.10 OMR

1.00 QAR 0.08 KWD

1.00 QAR 1.01 AED

1.00 QAR 0.10 BHD

1.00 QAR 0.11 OMR

1.00 KWD 12.00 AED

1.00 KWD 1.23 BHD

1.00 KWD 1.26 OMR

1.00 AED 0.10 BHD

1.00 AED 0.10 OMR

1.00 BHD 1.02 OMR

  • The program should print the available currencies for exchange which are:
    o SAR --> Saudi Arabia Riyal
    o KWD --> Kuwaiti Dinar
    o QAR --> Qatar Riyal
    o AED --> United Arab Emirates Dirham
    o BHD --> Bahraini Dinar
    o OMR --> Omani Rial
    Please make sure the user only enters the correct currency abbreviations (e.g., SAR). Otherwise, ask them to re-enter the currency until they get it right.
  • For usability reasons, the user can enter their currencies in capital or small letters (i.e., SAR, SaR, sar, and SAR are all correct inputs).
  • You are expected to use at least one void function and one value returning function. Feel free to use them for any part of your program.
  • The data file shows the currency exchange between two currencies. For example, if the file shows “1.00 KWD= 12.27 SAR”, you can use this line to exchange KWD to SAR and also exchange SAR to KWD
  • Comments that:
    o Explain the purpose of the program
    o Identify the owners (who wrote it) and their ID
    o Identify the input and output of the code
  • Comments that explain the purpose of every function, the function formal parameters
    (arguments) and return value.
  • White spaces such as indentation, spaces, and blanks
  • There are no marks for the evaluation, but your program will be correct if it provides similar output for the given input below: attached
.
Comments that:
o Explain the purpose of the program
o Identify the owners (who wrote it) and their ID
o Identify the input and output of the code
Comments that explain the purpose of every function, the function formal parameters
(arguments) and return value.
White spaces such as indentation, spaces, and blanks
There are no marks for the evaluation, but your program will be correct if it provides
similar output for the given input below:
Sample run1:
The currencies we have exchange for are
SAR-> Saudi Arabia Riyal
KWD - Kuwait Dinar
QAR - Qatar Riyal
AED-> United Arab Emirates Dirham
BHD - Bahraini Dinar
OMR - Omani Rial
What is the currency you have? Sa
What is the currency you want to exchange it for?
aed
How much money you want to exchange?
707
707 SAR is 692.86 AED
Sample run2:
The currencies we have exchange for are
SAR-> Saudi Arabia Riyal
KWD - Kuwaiti Dinar
QAR Qatar Riyal
AED - United Arab Emirates Dirham
BHD Bahraini Dinar
OMR-> Omani Rial
What is the currency you have? Kuwait
Incorrect abbreviation please provide it again
Sad
Incorrect abbreviation please provide it again
SAR
What is the currency you want to exchange it for?
BHR
Incorrect abbreviation please provide it again
BHO
How much money you want to exchange?
50
50 SAR is 5 BHD
Transcribed Image Text:. Comments that: o Explain the purpose of the program o Identify the owners (who wrote it) and their ID o Identify the input and output of the code Comments that explain the purpose of every function, the function formal parameters (arguments) and return value. White spaces such as indentation, spaces, and blanks There are no marks for the evaluation, but your program will be correct if it provides similar output for the given input below: Sample run1: The currencies we have exchange for are SAR-> Saudi Arabia Riyal KWD - Kuwait Dinar QAR - Qatar Riyal AED-> United Arab Emirates Dirham BHD - Bahraini Dinar OMR - Omani Rial What is the currency you have? Sa What is the currency you want to exchange it for? aed How much money you want to exchange? 707 707 SAR is 692.86 AED Sample run2: The currencies we have exchange for are SAR-> Saudi Arabia Riyal KWD - Kuwaiti Dinar QAR Qatar Riyal AED - United Arab Emirates Dirham BHD Bahraini Dinar OMR-> Omani Rial What is the currency you have? Kuwait Incorrect abbreviation please provide it again Sad Incorrect abbreviation please provide it again SAR What is the currency you want to exchange it for? BHR Incorrect abbreviation please provide it again BHO How much money you want to exchange? 50 50 SAR is 5 BHD
Write C++ program to currency exchange, which is the process that allows customers to
exchange one currency for another. The program will include decision-making statements,
loops, arrays, file I/O, string, and functions.
You should be following below details:
•
As you might know, currency rates are influenced by several factors such a country's
economic performance. Thus, it is better to get the up to-date currency rates from an
external source as it is easier to update. You should read the data from the file
"ExchangeRate.txt".
• "ExchangeRate.txt" file contain:
1.00 SAR 0.08 KWD
1.00 SAR 0.97 QAR
1.00 SAR 0.98 AED
1.00 SAR 0.10 BHD
1.00 SAR 0.10 OMR
1.00 QAR 0.08 KWD
1.00 QAR 1.01 AED
1.00 QAR 0.10 BHD
1.00 QAR 0.11 OMR
1.00 KWD 12.00 AED
1.00 KWD 1.23 BHD
1.00 KWD 1.26 OMR
1.00 AED 0.10 BHD
1.00 AED 0.10 OMR
1.00 BHD 1.02 OMR
The program should print the available currencies for exchange which are:
o SAR --> Saudi Arabia Riyal
o KWD --> Kuwaiti Dinar
o QAR --> Qatar Riyal
o AED --> United Arab Emirates Dirham
o BHD --> Bahraini Dinar
o OMR --> Omani Rial
Please make sure the user only enters the correct currency abbreviations (e.g., SAR).
Otherwise, ask them to re-enter the currency until they get it right.
For usability reasons, the user can enter their currencies in capital or small letters (i.e.,
SAR, SR, sar, and SAR are all correct inputs).
You are expected to use at least one void function and one value returning function.
Feel free to use them for any part of your program.
The data file shows the currency exchange between two currencies. For example, if
the file shows "1.00 KWD 12.27 SAR", you can use this line to exchange KWD to SAR
and also exchange SAR to KWD
Transcribed Image Text:Write C++ program to currency exchange, which is the process that allows customers to exchange one currency for another. The program will include decision-making statements, loops, arrays, file I/O, string, and functions. You should be following below details: • As you might know, currency rates are influenced by several factors such a country's economic performance. Thus, it is better to get the up to-date currency rates from an external source as it is easier to update. You should read the data from the file "ExchangeRate.txt". • "ExchangeRate.txt" file contain: 1.00 SAR 0.08 KWD 1.00 SAR 0.97 QAR 1.00 SAR 0.98 AED 1.00 SAR 0.10 BHD 1.00 SAR 0.10 OMR 1.00 QAR 0.08 KWD 1.00 QAR 1.01 AED 1.00 QAR 0.10 BHD 1.00 QAR 0.11 OMR 1.00 KWD 12.00 AED 1.00 KWD 1.23 BHD 1.00 KWD 1.26 OMR 1.00 AED 0.10 BHD 1.00 AED 0.10 OMR 1.00 BHD 1.02 OMR The program should print the available currencies for exchange which are: o SAR --> Saudi Arabia Riyal o KWD --> Kuwaiti Dinar o QAR --> Qatar Riyal o AED --> United Arab Emirates Dirham o BHD --> Bahraini Dinar o OMR --> Omani Rial Please make sure the user only enters the correct currency abbreviations (e.g., SAR). Otherwise, ask them to re-enter the currency until they get it right. For usability reasons, the user can enter their currencies in capital or small letters (i.e., SAR, SR, sar, and SAR are all correct inputs). You are expected to use at least one void function and one value returning function. Feel free to use them for any part of your program. The data file shows the currency exchange between two currencies. For example, if the file shows "1.00 KWD 12.27 SAR", you can use this line to exchange KWD to SAR and also exchange SAR to KWD
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education