Add files via upload

This commit is contained in:
Aesthetiful authored and GitHub committed 2024-03-11 12:33:03 -07:00
1 parent 1e19e7f773
commit 943f152ce6
12 files changed
+377 -170

No files matched your search

+22 -22
View File
@@ -1,22 +1,22 @@
public class Fundraiser {
private double target;
private double total;
private double count = 0;
public Fundraiser(double amount) {
total = amount;
}
public double averageDonation() {
return (count == 0) ? 0.0 : total / count;
}
public void addDonation(double amount) {
total += amount;
count++;
}
public double distanceToTarget() {
return (total >= target) ? 0.0 : target - total;
}
}
public class Fundraiser {
private double target;
private double total;
private double count = 0;
public Fundraiser(double amount) {
total = amount;
}
public double averageDonation() {
return (count == 0) ? 0.0 : total / count;
}
public void addDonation(double amount) {
total += amount;
count++;
}
public double distanceToTarget() {
return (total >= target) ? 0.0 : target - total;
}
}