Exercise: Smart Grid Energy Distributor
Explore Dart operators in this exercise by calculating fully charged batteries and remaining energy in a smart grid. Learn to use truncating division, modulo, and logical operators to determine grid stability while avoiding if statements.
We'll cover the following...
We'll cover the following...
Problem statement
A smart solar grid distributes its generated power into standardized battery packs. The system needs to calculate how many batteries are fully charged and how much raw energy remains unallocated. The power grid enters a "stable surplus" state only if there are zero loose remaining kilowatts AND the number of full batteries is strictly greater than the designated reserve threshold. ...