Incoming education secretary John King Jr. talks to D.C. students on Wednesday. (Perry Stein/The Washington Post)

Incoming U.S. education secretary John King, Jr. asked how many of the two dozen students in a McKinley Technology High School classroom want to study computer science in college.

More than half the students in the D.C. classroom — a group of teenagers in a predominantly black Northeast high school — raised their hands, a promising sign for an Education Department that wants to ensure that students of all backgrounds are prepared for professions in the science and technology fields.

“You are all the future of computer science,” King said Wednesday. “You can all be part of a different tech future. A more diverse tech future.”

King and other department officials visited the high school as part of Computer Science Education Week. Officials estimate that, by 2020, 51 percent of the jobs in science, technology, engineering and math (STEM) fields will be in computer science, amounting to a total of 1.4 million jobs. The problem, according to the Education Department, is that just 400,000 college graduates are expected to have the requisite skills to do those jobs.

King, along with other education leaders and computer scientists, talked to the students about applying to college and seeking science-related careers.

“You should figure out what you’re passionate about and there will be a computer science job for you,”  said Lisa Gelobter, the Education Department’s chief U.S. digital service officer, who previously had senior positions at Hulu and BET. “I never thought I’d be using computer science to help figure out how to get people to watch TV.”

The classroom visit also was an opportunity for King to pitch the government’s new College Scorecard initiative — a website that allows people to browse and compare colleges on different metrics, including graduation rates, post-college earnings of students who receive federal aid and more.

Leaders at ECMC Innovation Lab — the nonprofit arm of a student debt collection company — spoke to the students about computer coding. Using data from College Scorecard, the lab created its own site, Pell Abacus, which allows students who qualify for free or reduced-price lunches to see how much colleges would cost when taking financial aid into account.

King’s visit came the same day the Senate voted to pass a sweeping education bill that will put an end to the No Child Left Behind Act, giving more power over K-12 education policy to the states and local districts.

He takes the helm of the Education Department at the beginning of next year — Education Secretary Arne Duncan officially leaves the post at the end of December — and he says creating a better landscape for STEM education is one of the administration’s top priorities.

“We’re focused on equity,” he said. “How do you make sure all these opportunities are available to all students?”