Welcome! Log In Create A New Profile

Advanced

Not getting it Activity 7

Posted by Anonymous User 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Anonymous User
Not getting it Activity 7
March 16, 2009 09:14AM
Please help ppl. Check this 1 out!!! this is 4rm activity 7


//Inputs a person's initial, name and surname, then rearrages it.
#include <iostream>
#include <string>
using namespace std;

int main( )
{
string title, name, sur;
cout << "Please enter your title: ";
cin >> title;
cout << "Please enter your name: ";
cin >> name;
cin.get ();
cout << "Please enter your surname: ";
getline( cin, sur, '\n'winking smiley;
cout << "You are " << sur << ", " << title << ", " << name << endl << endl;

return 0;
}

my prob is the output will be the first one(highlighted)
the rest does not show. it comes out like this:
please enter your tittle _

this is only what hapens is my settings faulty or is there sumthing rong i do?
avatar Re: Not getting it Activity 7
March 16, 2009 09:41AM
Have a look at this thread --> Activity7thumbs up smiley
Anonymous User
Re: Not getting it Activity 7
March 16, 2009 02:04PM
be more specific mr Wiseguy. Explain sumthing
avatar Re: Not getting it Activity 7
March 16, 2009 02:33PM
Just click the link...eye popping smiley
Anonymous User
Re: Not getting it Activity 7
March 16, 2009 03:29PM
Renate if u copy & paste whats in the link, what do u get? Cause i still get the same results as before. i.e:
please enter your tittle _
Re: Not getting it Activity 7
March 17, 2009 09:21AM
lol
avatar Re: Not getting it Activity 7
March 17, 2009 11:43AM
When it says "enter your tittle" type the magic password and press enter, then the computer will show you the rest of your program.

Adults are always asking little kids what they want to be when they grow up because they are trying to get ideas.
- Paula Poundstone
avatar Re: Not getting it Activity 7
March 22, 2009 02:13PM
@spitfire, that's cruel ... lol

@festi. There's nothing wrong with the program. It's doing exactly what it's supposed to do. Your problem is that you're used to graphical programs and expect everything to be displayed all at once.

This is COS111, you're doing things the simple way. The code is running from the top of the function to the bottom one statement at a time. When it gets to the first cout statement, it displays the string on the screen. When it gets to the cin statement, it expects the user to provide some input. It will pause the program until you type something and press the enter key. Only then will the next cout statement be executed.

I hope this helps you understand your programs a bit better.
Anonymous User
Re: Not getting it Activity 7
March 23, 2009 08:45AM
Thanks robanaurochs uve been such a great help. i was realy straggling. I had to do guess work in my assignment(call me stupid). but now i understand everything.
avatar Re: Not getting it Activity 7
March 23, 2009 03:52PM
Doing assignments on guess work is a real challenge. I had to do most of mine without textbooks....
Sorry, only registered users may post in this forum.

Click here to login