Question
Part A: #include #include using namespace std; void FormSequence(vector remainTokens, vector pickedTokens) { unsigned int i; int pick; int sum; // ENTER THE MISSING PIECE
Part A:
#include
void FormSequence(vector
// ENTER THE MISSING PIECE OF CODE HERE AND TEST IT IN C++. DO NOT MODIFY THE REST OF THE CODE. (THANK YOU) else { for (i = 0; i
int main() { vector
cin >> vectSize;
for (i = 0; i > val; tokensToPick.push_back(val); }
cout
--------------------
PART B:
#include
void MakeWithdrawal(int totalMonth, int month, int savings) { if (month == totalMonth) { cout
// ENTER THE MISSING PIECE OF CODE HERE AND TEST IT IN C++. DO NOT MODIFY THE REST OF THE CODE. (THANK YOU)
} }
int main() { int totalMonth; int savings; cin >> totalMonth; cin >> savings; MakeWithdrawal(totalMonth, 1, savings); return 0; }
----------
PART C:
#include
int main() { ofstream outFS; int yucaCount; string friendName;
cin >> yucaCount; cin >> friendName; outFS.open("data.txt"); if (!outFS.is_open()) { cout // ENTER THE MISSING PIECE OF CODE HERE AND TEST IT IN C++. DO NOT MODIFY THE REST OF THE CODE. (THANK YOU) outFS.close(); return 0; }
Integer vectSize is read from input, then vectSize integers are read and stored into vector tokensToPick. Write the FormSequence() base case to output each element in vector pickedTokens whenever the size of pickedTokens is 2 . Output a space after each element. Then, output "sum is " followed by the sum of the elements in pickedTokens. End with a newline. Ex: If the input is 3162141 , then the output is: All possible sequences: 1621 sum is 37 1641 sum is 57 2116 sum is 37 2141 sum is 62 4116 sum is 57 4121 sum is 62 Complete MakeWithdrawal()'s recursive case: - If month is odd, call MakeWithdrawal() to compute the next month's savings as the current month's savings minus 4. - Otherwise, call MakeWithdrawal() to compute the next month's savings as the current month's savings minus 12. Ex: If the input is 5251 , then the output is: Month: 5, savings: 219 Integer yucaCount and string friendName are read from input. An ofstream named outFS is declared and the file named data.txt is opened. Write the following to the opened file: - "Note:" followed by a newline - yucaCount followed by " yucas for ", friendName, and a newline Ex: If the input is 34 Ayaka, then data.txt contains: Note: 34 yucas for AyakaStep 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