jeudi 1 octobre 2015

Interactive story program

Creating a program that makes use of arrays and pointers and takes several inputs from the user (e.g. Name, Age, etc.) and outputs them into a short story. The story has to be different each time the user runs the program however, like this:

Sample Output:

What is your name? Donkey
How old are you? 30
What is your favorite color? black
Donkey is a 30 year old who likes his black laptop...

Sample Output (second run of the same program):

What is your name? Donkey
How old are you? 30
What is your favorite color? black
Donkey is a 30 year old who likes his black Toyota Corolla...

I can get the inputs from the user and output them just fine; my problem is randomizing the events which incorporate the users data. I'm not really sure where to even begin. I've looked at rand() but I'm not sure how I'm supposed to incorporate it into my program. Any help would be appreciated!




Aucun commentaire:

Enregistrer un commentaire