If someone knows how to code in java and has some idea of how to do this please help.
this is what i have right now
>>57272978import java.util.pajeet;
public class Main {
public static void main(String[] args) {
Loo loo = new AbstractLooFactory();
loo.poo();
}
}
Just average the numbers.
Also, you don't need an array. Think about what an average is, mathematically.
well your kinda on the right track.
>>57273028
well the numbers entered are an amount that is up to the user so it has to be an array since it cant be a fixed amount
>>57273042
well atleast i thought it should be an array
>>57273042
Store the total and the amount of numbers entered. That's all you need. The requirements don't state you need to print out what the numbers actually were.
>>57273082
thanks for the advice ill look into it sorry for going full retard just started coding
>>57273118
want a solution in C++ or do you wanna work for it?
>>57273118
I just wish colleges would drop Java.
>>57273154
please deliver
>>57273167
why do you say that is it not a good base language to begin learning?
>>57273167
Java isn't that bad.
>>57273181
http://pastebin.com/6k1i6AxQ
I'll make it look more like java just for fun
This is why pajeets are ruling this industry now
>>57273267
fucking god
>>57273167
Why would they drop one of the most used programming languages?
>>57273222
It's not good though.
>>57273167
Couple of reasons. First, your professors are likely delusional and going to go on and on about how Java is the future or that it's used in everything when the reality is the opposite. Java is being phased out of what shit it was a part of, maybe they're thinking of JS. Java isn't used in any kind of important productions because it's bloated garbage.
Java has to run through the JVM and has all sorts of other intricacies that have to be taught.
Also, Java is usually the ONLY language that is taught despite the above which gives a huge disadvantage when people go in the work force and the only experience they have is academic work with Java. I mean you should be exploring different things on your own but the average person isn't gonna do that.
Not to mention you can do something in another language in 2 lines what takes Java 10.
bumpin
Just keep trying until you get it
>>57273267
here
Now don't get me wrong, whenever I read a new codebase at a new job I freak out for a couple of days. If you can't do this you're going to want to pick a different field. Sorry to repeat that meme but it's only going to be more painful from here.
>>57273619
thats clean as shit bro
>>57273627
naw i actually have 98 avg in the class, the professor just didnt finish his lecture and plus im swamped with a bunch of other course shit
>>57273619
thank you so fucking much
>>57273646
yeah, but this is some basic 'hello world' tier shit.
>>57273659
you're right i think it was the array shit that threw me off, thank god im not a cs major
>>57273653
If you couldn't figure this out from my C++ solution then I've got bad news for you..
>>57273639
Thanks m8
>>57273713
well even some of the stuff in your java is advanced from what we're doing at the moment, but like i said thank god im not a cs major
>>57273713
>in your java
No buddy, that is C++. Both solutions were C++.
Also I beg to differ but the code I showed is not advanced at all.
>>57272978
I'll do it for you for 10 bucks via PayPal. Seriously.
>>57272978
...i-is this a joke?
Hey OP I'm bored and mildly academic dishonest give me a few to get the old javac fired up and I'll make you some coffee buddy.
>>57272978
Who learns to code, only to get the answers from someone else?
YOU'RE PAYING TO LEARN AND YET YOU JUST WANT TO CHEAT
I DONT UNDERSTAND YOU PEOPLE
Something like this OP?
https://ghostbin.com/paste/446ox
>>57273619
Real slick code there m8
>>57274091
I-I don't actually know, learning to code by not coding at all.
>>57274486
This, so much. I get people try to pull this shit at college everyday and it's like IF YOU DON'T WANT TO LEARN TO CODE DON'T. BUT YOU NEED TO FIND ANOTHER MAJOR
>>57273627
This. What the fuck OP this is fizzbuzz tier
Here is a kind of sloppy implementation in Ada.
Translate to Java and modify according to request you're self, cheater.with Ada.Text_IO, Ada.Integer_Text_IO, Ada.Float_Text_IO;
use Ada.Text_IO;
procedure fagshite is
average : Float := 0.0;
count,
inp : Integer;
begin
loop
Put("Enter a number: ");
Ada.Integer_Text_IO.Get(inp);New_Line;
if(inp in Positive) then
count := count + 1;
average := average + (Float(inp) / Float(count));
else
exit;
end if;
Put("Average: ");
Ada.Float_Text_IO.Put(average, Fore => 4, Aft => 2, Exp => 0);
Put(" | Count: ");
Ada.Integer_Text_IO.Put(count);New_Line;
end loop;
Put("Average: ");
Ada.Float_Text_IO.Put(average, Fore => 4, Aft => 2, Exp => 0);
Put(" | Count: ");
Ada.Integer_Text_IO.Put(count);New_Line;
end fagshite;