I’m trying to understand how to calculate GDP for an economics assignment. I know it has something to do with consumer spending, investment, government spending, and exports minus imports, but I’m not completely sure how the formula works. Can someone explain the correct formula and maybe give a simple example? Also, what’s the difference between nominal GDP and real GDP?