Generation

class from descriptionSat, 14 Jan 2023

Totalizer for air pollution readings, with data on carbon dioxide, oxygen, dust

# public class Totalizer { private double co2; private double o2; private double dust; public Totalizer() { this.co2 = 0.0; this.o2 = 0.0; this.dust = 0.0; } public Totalizer(double co2, double o2, double dust) { this.co2 = co2; this.o2 = o2; this.dust = dust; } public void AddReading(double co2, double o2, double dust) { this.co2 += co2; this.o2 += o2; this.dust += dust; } public double GetCO2() { return co2; } public double GetO2() { return o2; } public double GetDust() { return dust; } public override string ToString() { return

Questions about programming?Chat with your personal AI assistant