Why does my terminal show a string like this?
That's based on the PS1 variable set in Bash's initialization. Yours appears to be the default, which is your computer's name, followed by a colon, then the current directory (in your example, that'd be the home directory for your computer [~]), then your username (david).

Here is an article about customizing your PS1, and there are plenty of questions both here and over at Super User about changing and fixing it.