BURNABY, B.C. - British Columbia's Education Ministry says students in Grades 6 to 9 will be taught mandatory classes in computer coding.

The ministry says $2 million will be spent on training teachers and developing a curriculum by next year so students can learn coding as of September 2018.

Another $2 million will be set aside for the purchase of equipment and resources which will allow every student in B.C. to take a module of basic coding by the end of Grade 9.

The ministry says learning to code will teach students how to analyze a problem, determine the steps to fix it and come up with directions so a machine can carry out those steps.

The Education Ministry says such critical thinking skills will help students in their future careers, even if they don't pursue jobs in the technology sector.

Premier Christy Clark and Education Minister Mike Bernier made the announcement at a school where students in Grades 4 to 7 showcased their coding and robotics projects developed with help from high school students.