I think your question means how did the discovery of gold contribute to the creation of the transcontinental railroad. There had been some movements toward westward settlement in the 1840s, but that trend accelerated dramatically with the discovery of gold in California. James Marshall's finding of gold at Sutter's Mill in California in 1848 led to a "gold rush" in the decade that followed, with 1849 seeing a huge influx of people to California. (Thus we refer to the '49ers.) The swift settlement of California added incentive to build a transcontinental railway. The Pacific Railroad Act of 1862 established the charter for doing that. The First Transcontinental Railroad was completed in 1869.
Opportunity cost refers to what you have to give up to buy what you want in terms of other goods or services. When economists use the word “cost,” we usually mean opportunity cost.
I would say A. This was a scandal involving the illegal manipulation of contracts by a construction and finance company associated with the building of the Union Pacific Railroad in the United States between 1865 and 1869.