Please enable JavaScript.
Coggle requires JavaScript to display documents.
class 7 (loops (for loop (it does not run the test par the first time…
class 7
loops
for loop
it does not run the test par the first time through, but the rest of the times following it runs that part first
-
-
-
-
-
-
common loop algorithms
sum and averages
sum
you can use while to add up the total number of inputs - use while bc you don't know how many nums are being inputed
-
avg
you can take the avg of inputs by using a var called count to count the number of inputs, adding the inputs, and dividing by count
note: in.hasNextDouble() - checks if input is a double/converts any given int to a double - going from int to double is always safe, but not double into int
-
-
-
-