• Congratulations to the Class of 2024 on your results!
    Let us know how you went here
    Got a question about your uni preferences? Ask us here

coding problem (1 Viewer)

puffkenny

******
Joined
Sep 13, 2003
Messages
228
Gender
Female
HSC
1999
hi, my code are as follows:

public double increaseBalance(double increment)
{
balance = balance + increment;
balance = balance * 0.99;
return balance;
System.out.println();
}

ok, my problem lies within the line System.out.println(); where i would have the system to display the amount of "balance" present. how can i do that? what would i put in the ()?
 

jogloran

Member
Joined
Jun 11, 2003
Messages
103
return exits the method.

You need to System.out.println(balance); first if you want to see it.
 

puffkenny

******
Joined
Sep 13, 2003
Messages
228
Gender
Female
HSC
1999
problem solved! (ages ago) thanks for your supports and sarcasms people :D
 

puffkenny

******
Joined
Sep 13, 2003
Messages
228
Gender
Female
HSC
1999
hahahah i failed, don't worry i will make sure my next assignment is perfect. now that I've actually started to learn :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top