If someone knows how to code in java and has some idea of how to do this please help.
If someone knows how to code in java and has some idea of how to do this please help
Other urls found in this thread:
pastebin.com
ghostbin.com
twitter.com
this is what i have right now
import 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.
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
well atleast i thought it should be an array
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.
thanks for the advice ill look into it sorry for going full retard just started coding
want a solution in C++ or do you wanna work for it?
I just wish colleges would drop Java.
please deliver
why do you say that is it not a good base language to begin learning?
Java isn't that bad.
I'll make it look more like java just for fun
This is why pajeets are ruling this industry now
fucking god
Why would they drop one of the most used programming languages?
It's not good though.
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
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.
thats clean as shit bro
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
thank you so fucking much
yeah, but this is some basic 'hello world' tier shit.
you're right i think it was the array shit that threw me off, thank god im not a cs major
If you couldn't figure this out from my C++ solution then I've got bad news for you..
Thanks m8
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
>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.
I'll do it for you for 10 bucks via PayPal. Seriously.
...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.
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?
Real slick code there m8
I-I don't actually know, learning to code by not coding at all.
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
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;