Can anyone help me include vectors in my code and check if everything checks out
ID: 3705802 • Letter: C
Question
Can anyone help me include vectors in my code and check if everything checks out.
kinclude 1 3 4 5 I/Global Constants const float FJD VATU = 52.96; const float FJD TALA = 1.25; const float TALA VATU 42.32; 7 9 10 I/Internal balance 11 float FJD INTERNAL BALANCE (10000)5 12 float VATU INTERNAL BALANCE (10000000)5 13 Float TALA INTERNAL BALANCE (1000000) 14 15 /Function signatures calculations 16 float converter(float input, float currency_exchange); 17 float vice versa converter(float input, float currency_exchange)5 18 19 Assertions 20 void converter-test(){ 21 assert(52.96--converter(1,FDD VATU)) assert(2=-converter(10000, FJDVATU)); 23 24 25 26Explanation / Answer
1. Include vector library
#include <vector>
2. Declare vector in the main method
vector <string> transactions;
3. In main function store the converted amount in a variable. Also pass the amount by reference, hence getting that value back.
4. For each transaction push_back string in the vector in the format
"Converted <<amount>> from <<>> currency to <<converted_amount>> in <<target currency>>"
This should be done before return in main method.
Also perform addition and subtraction from initial balance
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.