I believe you're thinking of Candide. I read that in 10th grade. It's a good book, as far as books go.
Ah, thank you for reminding me of the title. 'Twas many years ago I read it, hehehe.
I agree it was a good book. However, Voltaire's agenda in writing it was to refute the Christian dogma that all things work out for good, to those who love and trust in God.
Voltaire died an unbeliever, after a lifetime of trying to destroy religion. Reports stated that he was in despair on his deathbed, having seen a vision of hell to which he realized, too late, that's where he was headed. After his death, his home was converted into the home base of a missionary society. Serves him right!