We got assigned to make a mediaplayer with a playlist and some extra functions, the last function that doesn't work is the shuffle one.
I'll drop here the main. I know it's long..
...
Type: Posts; User: TmDee
We got assigned to make a mediaplayer with a playlist and some extra functions, the last function that doesn't work is the shuffle one.
I'll drop here the main. I know it's long..
...
This SHOULD BE the console:
Jordan d34
d34 Jordan
Jordan null
d34 null
Jordan d34
d34 Jordan
Jordan null
d34 null
I think my code says.
Make a Patient with naam: Jordan.
Then make a bed with nummer d34.
Then setBed(b1) does sets the number d34 to patient p1.
So when we print out p1 it return naam: Jordan...
Yes thank you I get that but I sorry, I can't see in my code where an variable is null, before I use a method to delete an variable.
Okay, I see but I still don't get it why it gives that null error, I probably should just wait and ask to my prof
Yes indeed it becomes null with the method, verwijderBed then it's says the value to zero but never before. I don't see it where it is null in the beginning do you?
I don't know why it's null, none of the variables is null from the object I try to print out.
The console should be:
Jordan d34
d34 Jordan
Jordan null
d34 null
Jordan d34
Don't get how it can give null value if I print the variables b1.getNummer() en p1.getNaam() it gives the values I want but when I put it in the toString methode it gives an error like you said a...
public class Bed {
private String nummer;
private Patient patient;
public String toString() {
return nummer +" " + patient.getNaam();
}
public Bed(String num) {
I searched a bit more but apparently it's an excercise about a subject that we haven't learn yet, so i'll be probably in the weekend back on to this!
I see so I deleted this from line 7 for both classes and it only prints out
Jordan
d34
Jordan
d34
Jordan
d34
Jordan
This is the main:
public class main {
public static void main(String[] args) {
Patient p1 = new Patient("Jordan");
Bed b1 = new Bed("d34");
p1.setBed(b1);
System.out.println(p1);...
Okay I read this and kinda understand this, but I think my prof will teach us later about that thanks tho both for the help! Really appreciate it!!
What do you mean final?
Thanks Norm and Jim for the help! I found it let me show it.
This is the main:
public class main {
public static void main(String[] args) {
ComplexGet getal1 = new ComplexGet(1.0,...
public class main {
public static void main(String[] args) {
ComplexGet getal1 = new ComplexGet(1.0, 2.0);
ComplexGet getal2 = new ComplexGet(3.0, 4.0);
System.out.printf("Som = %.1f +...
Som = 4,0 + 6,0i
Vermenigvuldiging = -12,0 + -30,0i
Inverteren = 899,9 + 900,0i
This is the console log and it should be by "vermenigvuldigen" -5 + 12i.
And your suggestion I don't really...
Yeah well I saw that so i posted the answers of the console under the image and it just didn't make any difference by clearing those commands that Jim told me.
Yeah saw that now too, thanks Jim!
3501
Console says for "optellen 4.0+6.0i. <-- this is correct.
for "vermenigvuldigen" : -12.0 + -30.0i
for "inverteren" : 899.9 + 900.0i
For multiplication, "vermenigvuldigen" the answer should...
public class ComplexGet {
private double re, im;
public ComplexGet(double reëel, double imag) {
re = reëel;
im = imag;
}
public double real() {
return re;