Took the exact same trip last may, (well not as a student)
i bought a 12" powerbook for the trip, and it was perfect. For that long plane ride, 2 batteries was good enough for movies, or itunes shows.
when over there, there's wifi hotspots, starbucks, and internet cafes everywhere.
another good thing is that instead of buying a cell phone to use, you can use skype to call home! (its MUCH cheaper)
now im a photographer, so having the laptop to download images was essential. I recommend getting a bag from crumpler ( i have the sinking barge bag)
its inconspicuous, holds tons of photo gear, a laptop, and a compartment for all your stuff u buy during your days out on the streets.
heres another hint...
when in madrid, do the following:
do NOT wear sandals, or flip flops, (you'll stick out like a sore thumb)
buy your mom and dad something nice from the huge store "el corte ingles" in the plaza del sol
remember to eat lots of tapas, and dont be afraid to go in and start a conversation (if u know enough spanish) patatas bravas, are amazing.
spend a late afternoon in the plaza de espana, have a glass of wine or an amstel, and watch the sun go down.
dont be a tourist...be a traveler (thanks anthony bourdain for that quote)