Can someone provide a C++ code for this question. ced C++ Your assignment is to
ID: 3732496 • Letter: C
Question
Can someone provide a C++ code for this question.
ced C++ Your assignment is to implement a currency transaction exchange. An experien programmer will achieve this task in about 40 minutes and take about 100 lines of code. As inexperienced programmers, the project is expected to require 4 hours work per week over 7 weeks. Your exchange must: Requirement 1 The program MUST provide a user interface and functionality for users . There must be an option to convert from Fijiian Dollars to Vanuatu Vatu and . There must be an option to convert from Fijiian Dollars to Samoan Tala and . There must be an option to convert from Samoan Tala to Vanuatu Vatu and Requirement 2 The program MUST provide a user interface option and functionality Hint: this requires keeping a list of previous transactions, something we won't to convert between Fijiian Dollars, Vanuatu Vatu and Samoan Tala. vice versa. vice versa. vice versa. to recall all the previous transactions since the start of the program. cover in class for the first few weeks. Requirement 3 The program SHOULD start with an internal opening balance of FJD$10,000, V10,000,000 and T1,000,000. Each transaction should increment or decrement the internal balances. Transactions that result in an internal balance that is less than 0 should be disallowed. To submit the assignment you must submit.Explanation / Answer
// DollarConversion.cpp
#include<iostream>
#include<stdlib.h>
using namespace std;
// Function to convert FJD to VUV and return the result
double fijiianToVanuatu(double fjd)
{
return fjd * 52.3262;
}// End of function
// Function to convert VUV to FJD and return the result
double vanuatuToFijiian(double vuv)
{
return vuv * 0.0191252072;
}// End of function
// Function to convert FJD to WST and return the result
double fijiianToSamoan(double fjd)
{
return fjd * 1.2540752959201;
}// End of function
// Function to convert WST to FJD and return the result
double samoanToFijiian(double wst)
{
return wst * 0.7974002863;
}// End of function
// Function to convert WST to VUV and return the result
double samoanToVanuatu(double wst)
{
return wst * 41.693680805;
}// End of function
// Function to convert VUV to WST and return the result
double vanuatuToSamoan(double vuv)
{
return vuv * 0.0239844499;
}// End of function
// Function to display menu, accept user choice and return it
int menu()
{
// To store user choice
int choice;
// Displays menu
cout<<" 1 -> Fijiian Dollars To Vanuatu Vatu [FJD -> VUV]";
cout<<" 2 -> Vanuatu Vatu To Fijiian Dollars [VUV -> FJD]";
cout<<" 3 -> Fijiian Dollars To Samoan Tala [FJD -> WST]";
cout<<" 4 -> Samoan Tala To Fijiian Dollars [WST -> FJD]";
cout<<" 5 -> Samoan Tala To Vanuatu Vatu [WST -> VUV]";
cout<<" 6 -> Vanuatu Vatu To Samoan Tala [VUV -> WST]";
cout<<" 7 -> STOP";
// Accepts user choice
cout<<" Enter your choice: ";
cin>>choice;
// Returns user choice
return choice;
}// End of function
// main function definition
int main()
{
// To store the value entered by the user
double value;
// Loops till user choice is not 7
do
{
// Calls the function to accept user choice and calls the appropriate function based on user choice
switch(menu())
{
case 1:
cout<<" Enter the FJD to convert it into VUV: ";
cin>>value;
cout<<" FJD -> VUV = "<<fijiianToVanuatu(value);
break;
case 2:
cout<<" Enter the VUV to convert it into FJD: ";
cin>>value;
cout<<" VUV -> FJD = "<<vanuatuToFijiian(value);
break;
case 3:
cout<<" Enter the FJD to convert it into WST: ";
cin>>value;
cout<<" FJD -> WST = "<<fijiianToSamoan(value);
break;
case 4:
cout<<" Enter the WST to convert it into FJD: ";
cin>>value;
cout<<" WST -> FJD = "<<samoanToFijiian(value);
break;
case 5:
cout<<" Enter the WST to convert it into VUV: ";
cin>>value;
cout<<" WST -> VUV = "<<samoanToVanuatu(value);
break;
case 6:
cout<<" Enter the VUV to convert it into WST: ";
cin>>value;
cout<<" VUV -> WST = "<<vanuatuToSamoan(value);
break;
case 7:
exit(0);
default:
cout<<" Invalid Choice. Try again........";
}// End of switch case
}while(1); // End of do while loop
}// End of main function
Sample Output:
1 -> Fijiian Dollars To Vanuatu Vatu [FJD -> VUV]
2 -> Vanuatu Vatu To Fijiian Dollars [VUV -> FJD]
3 -> Fijiian Dollars To Samoan Tala [FJD -> WST]
4 -> Samoan Tala To Fijiian Dollars [WST -> FJD]
5 -> Samoan Tala To Vanuatu Vatu [WST -> VUV]
6 -> Vanuatu Vatu To Samoan Tala [VUV -> WST]
7 -> STOP
Enter your choice: 1
Enter the FJD to convert it into VUV: 50
FJD -> VUV = 2616.31
1 -> Fijiian Dollars To Vanuatu Vatu [FJD -> VUV]
2 -> Vanuatu Vatu To Fijiian Dollars [VUV -> FJD]
3 -> Fijiian Dollars To Samoan Tala [FJD -> WST]
4 -> Samoan Tala To Fijiian Dollars [WST -> FJD]
5 -> Samoan Tala To Vanuatu Vatu [WST -> VUV]
6 -> Vanuatu Vatu To Samoan Tala [VUV -> WST]
7 -> STOP
Enter your choice: 2
Enter the VUV to convert it into FJD: 30
VUV -> FJD = 0.573756
1 -> Fijiian Dollars To Vanuatu Vatu [FJD -> VUV]
2 -> Vanuatu Vatu To Fijiian Dollars [VUV -> FJD]
3 -> Fijiian Dollars To Samoan Tala [FJD -> WST]
4 -> Samoan Tala To Fijiian Dollars [WST -> FJD]
5 -> Samoan Tala To Vanuatu Vatu [WST -> VUV]
6 -> Vanuatu Vatu To Samoan Tala [VUV -> WST]
7 -> STOP
Enter your choice: 3
Enter the FJD to convert it into WST: 45
FJD -> WST = 56.4334
1 -> Fijiian Dollars To Vanuatu Vatu [FJD -> VUV]
2 -> Vanuatu Vatu To Fijiian Dollars [VUV -> FJD]
3 -> Fijiian Dollars To Samoan Tala [FJD -> WST]
4 -> Samoan Tala To Fijiian Dollars [WST -> FJD]
5 -> Samoan Tala To Vanuatu Vatu [WST -> VUV]
6 -> Vanuatu Vatu To Samoan Tala [VUV -> WST]
7 -> STOP
Enter your choice: 4
Enter the WST to convert it into FJD: 60
WST -> FJD = 47.844
1 -> Fijiian Dollars To Vanuatu Vatu [FJD -> VUV]
2 -> Vanuatu Vatu To Fijiian Dollars [VUV -> FJD]
3 -> Fijiian Dollars To Samoan Tala [FJD -> WST]
4 -> Samoan Tala To Fijiian Dollars [WST -> FJD]
5 -> Samoan Tala To Vanuatu Vatu [WST -> VUV]
6 -> Vanuatu Vatu To Samoan Tala [VUV -> WST]
7 -> STOP
Enter your choice: 6
Enter the VUV to convert it into WST: 22
VUV -> WST = 0.527658
1 -> Fijiian Dollars To Vanuatu Vatu [FJD -> VUV]
2 -> Vanuatu Vatu To Fijiian Dollars [VUV -> FJD]
3 -> Fijiian Dollars To Samoan Tala [FJD -> WST]
4 -> Samoan Tala To Fijiian Dollars [WST -> FJD]
5 -> Samoan Tala To Vanuatu Vatu [WST -> VUV]
6 -> Vanuatu Vatu To Samoan Tala [VUV -> WST]
7 -> STOP
Enter your choice: 7