か」と

whether

→ か
phrase Rare #23,226
whether か marks a question, and と introduces the quoted words. In direct speech, this usually corresponds to a question mark before a closing quotation mark, followed by “said” or “asked.”
JA: 「明日は来ますか」と彼女が聞きました。
EN: “Are you coming tomorrow?” she asked.

「ああ、あのルノヴォか」とウィリアムが言った。

“Oh, that Lenovo,” William said.

「でも、君達がここに来るのは夏だけではないか」とトニーが言いました。

“But you only come here in the summer, don’t you?” Tony said.

「以前にどこかで会ったことがありませんか」とその学生はたずねた。

“Haven’t we met somewhere before?” the student asked.

「昨日あの授業の講義を聞いていましたか」と学生がたずねた。

A student asked, “Were you listening to the lecture in that class yesterday?”

「そうか」とデイヴィッドは言った。

“I see,” David said.

「花が咲いているか」と聞いた。

I asked whether the flowers were in bloom.

メアリーは私に「あなたは病気ですか」といいました。

Mary asked me, “Are you sick?”