I must have overlooked the $40K part, unless you are just being abstract.
The average high school diploma will probably get a job starting around $10 per hour, or around $20K per year if full time. After your proposed $40K degree, an average college graduate entry level job might get you about $40K per year, compared to half that without a degree. Now, you do lose the earned income over the 4 years or so while earning the degree, but you can still work part time. In this scenario, the degree pays for itself in about 6 years after graduation, with more growth opportunities thereafter.
Math being -
High School Diploma: 10 years working at $20k/yr, nets $200k
College Degree: 4 years not working (or limited work), minus $40k tuition, plus 6 years working at $40k, nets $200k
That's your break-even point. Anything after that is profit. Now that doesn't factor in the time value of money, but it also assumes no promotions during that timeframe. Just a hypothetical scenario, based on my observations and no statistical research. Results may vary.