For this lab you do not need to write code but rather will draw pictures to represent what declarations of data look like in memory. As a group you will do this drawing in a Google Slides document which will be provided for you. Once your group is done with your drawings, within Blackboard Collaborate let one of the TAs know by "raising your hand" and they will check and grade your work.
If you need help with BlackBoard Collaborate, check this document, or write a note on Piazza and one of the instructors can reply. I suggest you explore ahead of time how to use the drawing tools within Google Slides to cut/copy/paste boxes, lines, arrows and text boxes.
Each question is worth 1 point, for a maximum of 3.
Your lab's grad TA will randomly assign you to groups within Blackboard Collaborate. Your assigned group number will determine which slide to draw on. The group number assigned to each slide is given at the top of that slide. (Be careful. Since there is a title slide, the slide for group 1 to edit is actually on the second slide, and so on.) On the slide for your group first enter your group member names. Place your drawings adjacent to each declaration. Note that you can zoom in and out using Cntrl +/- (PC) or Cmd +/- (Mac).
Three completed examples (numbers 1-3) are shown below to give you an idea of what your diagrams should look like.
Here are the links to the editable Google Slides document to use for each lab. Be sure to select your lab, not some other one! You will not know which group you will belong to (within each document below) until the groups are assigned to you by your TA after your lab starts.
8am 9am 10am 11am 12noon 1pm 2pm 3pm 4pm 5pm Read-only Master
/* Lab 10: Picture Dynamic Memory
Objective: Draw Pictures of Computer Memory
*/
#include<iostream>
using namespace std;
int main() {
// 1.
int numbers[5];
//------------- Place drawing below this line ------------------
// 2.
char words[3][10];
//------------- Place drawing below this line ------------------
// 3.
int *pNumbers = new int[4];
//------------- Place drawing below this line ------------------
// 4.
char **pWords;
pWords = new char*[3];
for( int i=0; i<3; i++) {
pWords[i] = new char[5];
}
//------------- Place drawing below this line ------------------
// 5.
//Assume we have:
class Student{
public:
Student(){
initials[0] = 'D';
initials[1] = 'F';
initials[2] = 'R';
UIN = 12345;
}
private:
char initials[3]; // Delano Frank Roosevelt would be DFR
long UIN;
};
// Now draw the following:
Student cs141[3];
Student *pStudent = &cs141[2];
Student *pOther = pStudent;
//------------- Place drawing below this line ------------------
//6.
//Assume we have:
struct Node {
int data;
Node *pNext;
};
// Now draw the following:
Node n1;
n1.data = 3;
Node *pNode = new Node;
pNode->data = 5;
pNode->pNext = &n1;
pNode->pNext->pNext = pNode;
//------------- Place drawing below this line ------------------
return 0;
}