write only the main() method using the exact steps.
- create a ref called al of the given class
- create an object for that ref
- send the setup() message passing "mike" and reading in 100 for the scan
- deposit 20.50 into his account
- withdraw 3 from his account
- print his new balance without saving the received value in a variable
Using the same class above on the right hand side, correct any errors without changing the method name.
A. double d = a1.deposit("Sarah");
b. string s = a1.who ("Sarah");
c. double d = a1.withdraw(10);
I need help with this practice exercise, where should i start to create the reference called a1 and create an obj for that ref...thank you !
pierre val wrote:I need help with this practice exercise, where should i start to create the reference called a1 and create an obj for that ref...thank you !
Well, you know how to create an object don't you? I doubt they would have given you this exercise if they haven't explained that to you.
And the instructions tell you that you're writing the main() method. So my suggestion: Try a few things out for yourself, and come back and show us your main() method if you have problems.
PS: And welcome to JavaRanch!
pierre val wrote:ya this is my homework and that is what the professor wrote in the assignment. i'm kinda confuse about it too, but maybe he wants us to change something in the setUp method but im not so sure
call the setup() method passing "mike" and entering in 100 for the scan
Nothing here implies changing setup().