I have an assignment due tomorrow, my professor hasn't taught the class much of anything other than what other careers there in the programming field and how other careers differ from programming. He hasn't been of much help at all and I'm at a total loss of how to start this. I've read the book, but it doesn't seem to be helping me for I am still at a loss.
The assignment is:
Description
You are to write a “lame” adventure game. You are to prompt the user for their name and the number of adventures. You will have a constant for the percentage of adventurers killed off at each adventure and the amount of treasure earned at each adventure. After the prompts the game will tell a story about a group of adventurers led by the user. The adventures will encounter danger and find treasure. After each danger display the amount of treasure acquired and the number of adventurers left.

Example
(Blue indicates the user response)
What is your name? Fred Symth
How many men did you start with ? 21
You are Fred Symth leader of the space mission Olympus with 21 team members.
You have just gotten too close to a black hole.
Although sacrificing 5 members of the space mission you have found 5 more dylithium crystals but have only 16 team members left.
Now you encounter the dreaded Panther People of Pluto. (and so on)…

I just need help on the basic things such as how do I prompt the use into putting in their name and the number of people that they have started with.

Can anyone please help a n00b out? :\

Recommended Answers

All 3 Replies

output:

cout << "Hello, World\n"; // '\n' returns the line

input:

cin >> var1; //sets var1 to the user input (most of the time)

Research "cin.getline" there's a start!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.