Ich hab ne Hausaufgabe in Java auf und weiß net so ganz ob das stimmt.
Aufgabe:
quote:
Schreiben sie ein Programm, welches einen Promillerechner (für Männer) simuliert.
Der aufgenommene Alkohol muss in Gramm und das Körpergewicht in Kilogramm angegeben werden.
c (in Promille) = A / (r*G)
A:aufgenommener Alkohol in Gramm
r: Verteilungsfaktor im Körper (0,7 für Männer)
G: Körpergewicht in Kilogramm
Ok, und nun mein Script:
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
public class Promillerechner
{
public static void main (String args[])
{
double c = A/(r*G);
double A = 50/1000;
double r = 0.7;
int G = 70;
System.out.println(c);
}
}
Ist das so ok ?
BTW: Ich arbeite seit heute mit Joe und komm noch nicht so ganz damit klar.
Wenn ich auf Starten gehen öffnet sich der CMD und es kommt:
Deshalb auch meine Frage, obs ok ist.
Wär cool wenn mir jemand helfen könnte, bin noch neu auf dem Gebiet Java.
public class Promillerechner
{
public static void main (String args[])
{
double A = 50/1000;
double r = 0.7;
int G = 70;
double c = A/(r*G);
System.out.println(c);
}
}
If you were enjoying this post and if you keen on reading more interesting stuff then do not hesitate to complete the free sign up.
After the free registration you will gain access to all areas and you will be able to communicate with other artists from all over the world.
In addition you will benefit from our Photoshop and coding section as well as from our huge (hundreds of gigabytes) free resource section where you can find everything you will need to be a successful (web) designer/artist.
Sign up now and enjoy the advantages as a registered member.
(This website will be ad-free after a complete free sign up.)