From bdc8183439a2c4b512b75c93bd342e9154a81bbf Mon Sep 17 00:00:00 2001 From: MrPOS666 Date: Mon, 16 Sep 2024 17:33:17 -0400 Subject: [PATCH 1/2] Finished TODO in DataTypes --- src/DataTypes.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DataTypes.java b/src/DataTypes.java index 4f807c1f..3f61a2a3 100644 --- a/src/DataTypes.java +++ b/src/DataTypes.java @@ -4,9 +4,9 @@ public class DataTypes { // TODO TASK 1: fix this code so that it passes the test in DataTypesTest.java public static long sum(List numbers) { - int s = 0; + long s = 0; // below is a "foreach" loop which iterates through numbers - for (int x : numbers) { + for (long x : numbers) { s += x; } return s; From f30cfb61cdabdea417157bf832a86c33a9d5e3bb Mon Sep 17 00:00:00 2001 From: MrPOS666 Date: Mon, 16 Sep 2024 17:46:33 -0400 Subject: [PATCH 2/2] random --- src/DataTypes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataTypes.java b/src/DataTypes.java index 3f61a2a3..aa20b8a3 100644 --- a/src/DataTypes.java +++ b/src/DataTypes.java @@ -7,7 +7,7 @@ public static long sum(List numbers) { long s = 0; // below is a "foreach" loop which iterates through numbers for (long x : numbers) { - s += x; + s += x + 1; } return s; }