Created
May 24, 2022 12:14
-
-
Save lgolubyev/caee5a2533ee0df0b17c5bf0ea52e53f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Battery battery = new("CR2032", 0.235, 100); | |
WriteLine(battery); | |
while (battery.RemainingCapacityPercentage > 0) | |
{ | |
battery.RemainingCapacityPercentage--; | |
} | |
WriteLine(battery); | |
public record struct Battery(string Model, double TotalCapacityAmpHours, int RemainingCapacityPercentage); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment