#table java help
61 messages · Page 1 of 1 (latest)
Update: Discord changed their client to prevent sending messages
that are preceeded by a slash (/)
To run code you can use "./run" or " /run" until further notice
Here are my supported languages:
awk, bash, basic, basic.net, befunge93, bqn, brachylog, brainfuck, c, c++, cjam, clojure, cobol, coffeescript, cow, crystal, csharp, csharp.net, d, dart, dash, dragon, elixir, emacs, emojicode, erlang, file, forte, forth, fortran, freebasic, fsharp.net, fsi, go, golfscript, groovy, haskell, husk, iverilog, japt, java, javascript, jelly, julia, kotlin, lisp, llvm_ir, lolcode, lua, matl, nasm, nasm64, nim, ocaml, octave, osabie, paradoc, pascal, perl, php, ponylang, powershell, prolog, pure, pyth, python, python2, racket, raku, retina, rockstar, rscript, ruby, rust, scala, smalltalk, sqlite3, swift, typescript, vlang, vyxal, yeethon, zig
You can run code like this:
./run <language>
command line parameters (optional) - 1 per line
```
your code
```
standard input (optional)
Provided by the Engineer Man Discord Server - visit:
• https://emkc.org/run to get it in your own server
• https://discord.gg/engineerman for more info
Update: Discord changed their client to prevent sending messages
that are preceeded by a slash (/)
To run code you can use "./run" or " /run" until further notice
Here are my supported languages:
awk, bash, basic, basic.net, befunge93, bqn, brachylog, brainfuck, c, c++, cjam, clojure, cobol, coffeescript, cow, crystal, csharp, csharp.net, d, dart, dash, dragon, elixir, emacs, emojicode, erlang, file, forte, forth, fortran, freebasic, fsharp.net, fsi, go, golfscript, groovy, haskell, husk, iverilog, japt, java, javascript, jelly, julia, kotlin, lisp, llvm_ir, lolcode, lua, matl, nasm, nasm64, nim, ocaml, octave, osabie, paradoc, pascal, perl, php, ponylang, powershell, prolog, pure, pyth, python, python2, racket, raku, retina, rockstar, rscript, ruby, rust, scala, smalltalk, sqlite3, swift, typescript, vlang, vyxal, yeethon, zig
You can run code like this:
./run <language>
command line parameters (optional) - 1 per line
```
your code
```
standard input (optional)
Provided by the Engineer Man Discord Server - visit:
• https://emkc.org/run to get it in your own server
• https://discord.gg/engineerman for more info
just add them up and divide by 3?
without writting them and dividing by 3 thats what i did
it works but not the right method...
i need to do it without only the parameter i selected
everyting below that shouldnt be used
basically i need to do the average of the numbers elected from this
which ones?
@gloomy turret moyen de l'expliquer en français pour moi pouvoir peut-être t'aider ? Car là j'y comprend rien
basically tu vois je dois faire la moyenne de les nombre que j'ai selectione la
Ouais
sans utiliser cette methode
a gauche la

avec ca
tu vois ce que je veux dire?
Déjà pense au fait que tu peux faire des classes autres (genre une classe Personne avec toutes les infos directement dedans)
Et pour résoudre ton problème ptetre
for (int i = 0; i < matricule.length; i++) {
double moyenne = (noteMat[i] + noteInf[i] + noteFra[i]) / 3
// puis faire le code qui va avec, ou le stocker en arrière avec l'exemple qui suit
}
// "l'exemple qui suit" c'est:
int[] moyennes = new int[nomPrenom.length];
// a mettre dans la boucle for() à la suite
moyennes[i] = moyenne
This is an english-only server (see #rules) Please keep the discussion in english.
Oh mb sry
no problem
👍
nvm its not that i only need to do one but whatever thanks
Strange but ok
it does not works 
ye but without the thing you proposed or not?
wdym?
The concerning part like above
Ouch
Ok im redoing the whole method here lol
And pleeeasse do Ctrl+Shift+F to reformat your code lol
public static void produireSomme(Scanner clavier, String[] nomPrenom, float[] noteInf, float[] noteMat, float[] noteFra, int[] matricule) {
int length = matricule.length;
float moyInf = 0, moyMat = 0, moyFra = 0;
float[] moyennes = new float[length];
float moyenneTotale = 0
for(int i = 0; i < length; i++) {
moyInf += noteInf[i];
moyMat += noteMat[i];
moyFra += noteFra[i];
moyennes[i] = (noteInf[i] + noteMat[i] + noteFra[i]) / 3;
moyenneTotale += moyennes[i];
}
moyInf /= length;
moyMat /= length;
moyFra /= length;
moyenneTotale /= length;
System.out.println(String.format("%-9s %-25s %-5s %-5s %-5s %-7s", "Matricule", "nom, prénom", "INF", "MAT", "FRA", "Moyenne"));
System.out.println("-".repeat(64));
for(int i = 0; i < length; i++)
System.out.println(String.format("%-9d%-25s%-7.2f%-7.2f%-7.2f%-7.2f", matricule[i], nomPrenom[i], noteInf[i], notMat[i], noteFra[i], moyennes[i]));
System.out.println("-".repeat(64));
System.out.println(String.format("%15s%24.2f%7.2f%7.2f%7.2f", "Moyenne", moyInf, moyMat, moyFra, moyenneTotale));
}
Lol took me 25min to write on phone 🥵 
wow if it works then you deserve everything

i think it might be coz of the floats
yeah it was that
Yea i maybe bad recopied the formatters
it works but i cant be using 3 tho
3?
it need to works no matter what the length of the table
yah yeah nvm im done with it thanks
Yeah 3 is just length
Hmm not length im idiot its 3 but ok
If all works dont forget to close the thread ;)
in your CODE it doesnt show the real decimals it only shows 00 after the comma
Just copied yourse, im not good with format
Its alright im completely done now 100%
