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:

Part A: #include #include using namespace std; void FormSequence(vector remainTokens, vector pickedTokens)

#include #include using namespace std;

void FormSequence(vector remainTokens, vector pickedTokens) { unsigned int i; int pick; int sum;

// 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 tokensToPick(0); vector picks(0); int vectSize; int val; unsigned int i;

cin >> vectSize;

for (i = 0; i > val; tokensToPick.push_back(val); }

cout

--------------------

PART B:

{ unsigned int i; int pick; int sum; // ENTER THE MISSING

#include using namespace std;

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:

PIECE OF CODE HERE AND TEST IT IN C++. DO NOT MODIFY

#include #include using namespace std;

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 Ayaka

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!