Opportunity cost is one way to measure the cost of something. Rather than merely identifying and adding the costs of a project, one may also identify the next best alternative way to spend the same amount of money. The forgone profit of this next best alternative is the opportunity cost of the original choice. A common example is a farmer that chooses to farm their land rather than rent it to neighbors, wherein the opportunity cost is the forgone profit from renting. In this case, the farmer may expect to generate more profit alone. Similarly, the opportunity cost of attending university is the lost wages a student could have earned in the workforce, rather than the cost of tuition, books, and other requisite items (whose sum makes up the total cost of attendance).
Note that opportunity cost is not the sum of the available alternatives, but rather the benefit of the single, best alternative. Possible opportunity costs of a city's decision to build a hospital on its vacant land are the loss of the land for a sporting center, or the inability to use the land for a parking lot, or the money that could have been made from selling the land, or the loss of any of the various other possible uses — but not all of these in aggregate. The true opportunity cost would be the forgone profit of the most lucrative of those listed.
One question that arises here is how to determine a money value for each alternative to facilitate comparison and assess opportunity cost, which may be more or less difficult depending on the