A Georgia man told a judge he committed two armed robberies to pay for school before he was sentenced to 15 years in prison Monday.

In addition to prison time, Javar Rashard Haywood, 28, will also serve 15 years probation for his Fourth of July robbery spree last year.

One of the crimes happened at a Chevron gas station in Macon where a clerk was wounded after he was shot at through the bulletproof glass, The Macon Telegraph reported.

Javar Rashard Haywood, 28, reportedly told a judge he committed two armed robberies to get money to obtain his GED diploma during his sentencing in a Georgia court Monday.  (Bibb County Jail)

The other stickup occurred at a Waffle House where Haywood netted $200, prosecutors said. He said he needed the money to get his GED diploma.

Prosecutors said Hatwoof leaped over the counter and held a waitress at gunpoint. Judge Howard Z. Simms asked Haywood how much a GED costs.

“Two hundred (dollars),” Haywood answered. “If you don’t have financial aid.”

CLICK HERE TO GET THE FOX NEWS APP

“Maybe you should have filled out an application at the Waffle House instead of (going in) to rob it," Simms replied.

Prosecutor Sandra Matson said she “can only assume that drugs, possibly, played a role in this. But he basically thought he could just go across our town committing armed robberies. ... So he deserves every day that he’s getting.”