Thanks for posting it, I get how to use now, well sorta. But when doing the average, why is it that you have to put the (double) like that, I saw it in my book but it doesnt explain why.
On another...
Type: Posts; User: napenthia
Thanks for posting it, I get how to use now, well sorta. But when doing the average, why is it that you have to put the (double) like that, I saw it in my book but it doesnt explain why.
On another...
ok i used the while loop with a sentinel value, and put the average at the end like you suggested here is what i got. would you mind posting the way you did it so that i can compare, and so that i...
ok so i change that, but i still need to find a way to calculate the average, would i still need the if statement then?
ok this is what i have so far but i am a little confused as how to incorporate the if statement in here, should i change anything?
import java.util.Scanner;
public class Main {
...
ok cool, im gonna try it out and ill post what i have for you to check but what kind of loop should i be using? I thought maybe a do while loop but im not sure
Design and implement an application that reads a list of positive integers values and calculate their average. List terminates with -1.
What I would like to know is would I be using the if/else...