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

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 #include using namespace std;

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

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!