Re: Unwanted Null output.
And please tell me what the Java BB code is :P
And tell me what you need to know if it makes finding the problem easier:D
Re: Unwanted Null output.
What output do you actually see?
How is the above code called?
You need to sort out some of your indenting, but you found the code tags at least...which is something of a rarity around here.
:)
1 Attachment(s)
Re: Unwanted Null output.
This is displayed in the output:
Attachment 4210
Here is how i call the code.
Code:
package obligatorisk.innlevering.pkg2;
public class ObligatoriskInnlevering2 {
public static void main(String[] args) {
Studenter Stud = new Studenter();
Stud.DelUt();
Stud.utSkrift();
Stud.karStudenter();
}
}
Re: Unwanted Null output.
Your calls are in the wrong order.
The 'karakter' array is not populated before the utSkrift() call.
You have it populated afterwards.
Re: Unwanted Null output.
ahh! I changed the order and atleast i get an output now!
Only problem is that everyone gets an F...
Re: Unwanted Null output.
can anyone see why i only get F`s? I cant figure this shit out and its killing me slowly...
Re: Unwanted Null output.
You'll need to do some debugging.
Put some println() statements in there printing out what various values are, specifically around the values being put into the bestaat array, since that's what defines what grade is used.
Re: Unwanted Null output.
Quote:
Originally Posted by
Tolls
You'll need to do some debugging.
Put some println() statements in there printing out what various values are, specifically around the values being put into the bestaat array, since that's what defines what grade is used.
Hey! I got it working yesterday already!
Turns out i had to change
Code:
public int studentNummer(int i)//Studentnummer
{
int studentNummer = 1 + i;//Her er det viktig at studentnummeret starter på over 30. Om vi starter på for ekesempel 1, får alle studentene F som karakter. Dette er en svakhet i koden.
return studentNummer;
}
to this
Code:
public int studentNummer(int i)//Studentnummer
{
int studentNummer = 30 + i;//Her er det viktig at studentnummeret starter på over 30. Om vi starter på for ekesempel 1, får alle studentene F som karakter. Dette er en svakhet i koden.
return studentNummer;
}
The studenNummer has to be over 30 for it to work.
This is a weakness in the code, but i see no other way of making it work.