Forget about the cost of solar panels, the cost of batteries. Let's focus on how much power solar panels can produce and how much power solar cars need.
This is the very first step we must do, to understand if a dream like solar cars are something that we are going to see in the near future of if they are going to stay in our dreams.
Let's start from some facts: in the US there are 250 million cars, and they use about 9 million barrels of gasoline every day. Quite impressive: more than 3000 gallons per second!
Let's go ahead with the calculations.
As a liter of gasoline "contains"
Quite a big panel, unfortunately. For sure, you cannot have a solar car with solar panels on the car roof, there is no way to achieve that with today's technology. And there is no hope that this will be possible in the very near future.
This doesn't mean that solar cars are of no interest, of course. It's just something that we should keep in mind when talking about possible solutions for the problem of scarcity of energy resources and for the switch to renewable energy sources.