David McCormick has been elected to the U.S. Senate after winning a pivotal race in swing-state Pennsylvania, according to the Associated Press.