[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

If someone knows how to code in java and has some idea of how

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 40
Thread images: 4

File: code2.png (97KB, 1033x564px) Image search: [Google]
code2.png
97KB, 1033x564px
If someone knows how to code in java and has some idea of how to do this please help.
>>
File: code1.png (53KB, 1798x815px) Image search: [Google]
code1.png
53KB, 1798x815px
this is what i have right now
>>
>>57272978

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.
>>
>>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
>>
File: java_c++.png (18KB, 516x559px) Image search: [Google]
java_c++.png
18KB, 516x559px
>>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.
>>
File: 1475151810749.jpg (9KB, 184x200px) Image search: [Google]
1475151810749.jpg
9KB, 184x200px
>>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;
Thread posts: 40
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.