Think Pair Share 26
- Due Nov 19, 2020 by 10am
- Points 1
- Submitting a file upload
- Available after Nov 18, 2020 at 10am
Think
Insert a new row just below the header in the table in your TPS Google Doc. Fill in the first two columns. Place your response to the following in the "Think" column:
Suppose I have a program that displays an invoice for an oil company. The output should appear like this:
Services:
tuneup..........$ 99.99
Materials:
piping..........$ 10.00
insulation......$ 15.00
--------
TOTAL $ 114.99
========
Assume I have this struct:
struct Item {
string name;
double value;
};
and these variables:
vector<Items> services; // Holds the services.
vector<Items> materials; // Holds the materials.
double sum = 0;
Each item should be indented 2 spaces and have a width of 16 and filled with the dots. The prices (values) should have 4 digits before the decimal and 2 after.
Write the code to output the tune up line, assuming it is contained within the Item instance in services.at(0).
You may look at zyBook Ch. 9.2 for reference.
Pair
If you are joining the class live (in person or over Zoom), pair up with someone when asked to do so—please use Discord or your preferred means of interacting with someone to share your answers (please see the announcement with details about Discord). Settle on an answer between to two or three of you and put that answer down in your "Pair" column.
Share
Regardless of whether or not you are attending live, one person from your pair group should add your answer to the "TPS class share Links to an external site." document.
Submit
Finally, submit your personal TPS Google doc to this assignment.
Rubric
Criteria | Ratings | ||
---|---|---|---|
You uploaded your copy of the TPS Google doc
|
|
||
You made a reasonable attempt at the "thinking" portion and this was clearly marked on your document
|
|
||
You made a reasonable attempt at the "sharing" portion and this was clearly marked on your document
|
|
||
|