Instead of focusing on the second bar, take a look at the first one.
While the first note is a D, as the chord is, the second is clearly not an A, but it's a C#.
When you have [capitalized] letters on top of your staff, they most probably indicate the tonic (or the root) of the chord that is going to be played, not the specific note, otherwise the note to be played by the bass will be what is followed by the slash (if it exists), unless explicitly written in the instrument notation.
In your case the bass line is written, but if it's not and you see something like
A/C# it means that the bass should theoretically play the C# note, even when the actual chord is A [major]: a more correct chord writing of the above would have
A/C# written in the second half of the first measure.
In this specific case, the text-written note does not indicate the root note of the chord (so it should be [A]), but the basic chord itself: C# is the third of A [major].
Do consider that it is possible that a note of the bass line can be a note that is not part of the overlying harmony: you can have a natural C in the bass, even if the harmony requires a C# (and even a B♭, which is not always the same thing).
First you have to read all notes correctly. Look up the bass clef.
Then - like other answers say - the capital letters are chord symbols. Write down all triads of the chords D,G,A and you will find that the tones of these bass line are either the root, third or fifth of these chords (except some quarters that are passing notes.)
Turn back to page 22, and read the explanatory text at the top. The relevant portion:
The bass line corresponds directly to chords that a guitarist or pianist plays. They will be written above each measure so that your teacher or a friend can play along with you. If you examine the bass line, you will see that when the chord symbol says E7, the bass starts the measure with an E; when the chord changes to A7, the bass plays A; etc. You are playing the root of the chord, a very important aspect of functional bass playing.
(Bold and italic text reflect the original.)
In the example you're asking about, the last sentence is no longer true: Sometimes you play the third or fifth of the chord (which is another important aspect of functional bass playing).
FWIW, here's a picture of the same exercise from the same book (Bass Method Book 1 by Ed Friedland) that was used by a young student of a music school. The bass teacher has most probably explained about chord symbols, and told the student to add the written bass inversions (the notes on the staff) using slash chord notation, which the student has apparently done:
I wanted to post this just to show that it's good to have a teacher. :) It's the teacher's job to make sure that the student doesn't miss important things.