Question: Hi, I need help with my code... I have been able to have it give me an output of 7 but I can't have it

Hi, I need help with my code... I have been able to have it give me an output of 7 but I can't have it print multiple outputs like the picture, please help.
Here's my code:
#include
class NodeSimple { public: int key; NodeSimple* next; };
int main(){ NodeSimple* n; NodeSimple* head; int die1=0; int die2=0; srand(13); head = 0; while (die1 + die2 != 7){ // Roll Die die1 = rand()%6+1; die2 = rand()%6+1; // Create new node n = new NodeSimple; n->key = die1 + die2; // Link new node to current head // of list n->next = head; // Make head point to new node head = n; } // Print All Dice Rolls n = head; while (n!=0){ cout key next; } return 0; }
When you are done developing your code and are ready to submit for grading, press the submit Develop Submit button below. This will submit your program for grading SUBMIT FOR GRADING SUBMITTED: 01:35 PM ON 03/29/17 Total: 1/2 1. Unit test Code Compiles 2. Compare output Your output Expected output 8 DOWNLOAD SUBMISSION
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
