Read all of what follows…
In Q1, I have given you a list of words that a complete explanation would use. Failure to use any of these words will result in a loss of points.
Where it says "assign / assigns / assigned / assignment", you only need to use one; I could not anticipate how you would choose to phrase the relevant sentence. Similar comments apply to "display", "convert", and "truncate".
In Q2, I have asked for regular status updates on the contents of the input buffer and for you to use the supplementary materials. Here is a different question and answer so that you have something to model your solution on…
int main() { cout << "Type the commented line of code:" << endl; /* 8 eight */ int i; cin >> i; string s; getline(cin, s); cout << "Line 1: " << i << endl; cout << "Line 2: " << s << endl; return 0; }
After running the code, the console looks as follows…
Type the commented line of code: 8 eight Line 1: 8 Line 2: eight
I'll now explain how the code executes.
First, "Type the commented line of code:" is printed to the console together with a new line character.
Next, an int i is declared and we encounter cin >> i, so we follow steps 1-4 of the relevant part of the supplementary materials.
BUFFER STATUS: "8 eight\n"
BUFFER STATUS: " eight\n"
Next, a string s is declared and we encounter getline(cin, s), so we follow steps 1-3 of the relevant part of the supplementary materials.
BUFFER STATUS: "\n"
BUFFER STATUS: ""
Next, we print "Line 1: 8" with a newline character (since i stores the int 8).
Finally, we print "Line 2: eight" with a newline character. That's two spaces between the colon and the 'e'. This is because the string literal had a space at the end and s stores " eight".
In Q3, I have provided expectations of what your picture and prose should include. There are 7 bullet points and 6 points allocated to the question. You should therefore expect that a failure to observe one of the bullet points results in at least a one point deduction.
Regarding the instruction "you can satisfy the last bullet point by labelling your picture with numbers in a different color to your normal writing", here is a video to demonstrate.