Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[1] Objective: This assignment is designed to test your understanding of the syntax in Chapter 2 including loops and switch statements, enumeration type and functions.
[1] Objective: This assignment is designed to test your understanding of the syntax in Chapter 2 including loops and switch statements, enumeration type and functions. You will write some simple functions using value parameters (only). This assignment also demonstrates the design pattern of menu-driven programming. [2] Description: In this assignment you will write a program that facilitates the exchange of currency exchange between Mexican Peso (MXN) and USD. The program is designed to run for a whole business day, so you will have to terminate it with a special sentinel as you have been doing in the last few assignments. The functionality of the program should be obvious from the "menu" below There is an exchange rate to convert between Mexican Peso and the USD and it is about USD 1 MXN 13.3. However, as a business, you won't make any money if you trade the money using the "fair" rate. You want to make a 7% profit So for people to sell dollar at 13.3 0.93- 12.369 "selling" rate. On the other hand, for people to buy dollar, the "buying" rate is 13.3 1.07-14.231 to a dollar. Your program should keep the real rate in memory and compute the buying and selling rate when needed. After taking the input from the user, your program should use a Switch statement to handle each individual case. You will write the following functions for this programming assignment. Double exchange (double rate, exType ex) .double setRate (double rate); double loadRate(); void showRates (double rate); int showMenu(double rate) Where exType is defined as enum exType (BUY, SELL) the showMenu0 function displays information as shown in the example below and prompt for an input. The showRates)function displays both selling and buying rates as shown in the example above. LoadRate will load the initial Peso rate from the file called rate.txt. CURRENCY EXCHANGE MEXICAN PESOSUSD Buying Pesos Selling Pesos $112.3690 MXN 14.2310 MXN Select the option
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started