So if your code is Java, why are you posting it in the C++ forum?
For setting the pizza size, first of all you get the user's input, and store it in a variable. Such as:
int thesize=stdin.readLine();
Then you can set the pizza's size: large.setPizzaSize(thesize);
Hope this helps
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
It's java? I did not know that. The books just says that its just logicals to writing programical codes. And thanks for replying.
Don't you have any notes from school?
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
It's java? I did not know that. The books just says that its just logicals to writing programical codes.
C++ code *should* always start it's main program code with:
int main() { /*...*/ }
(some ignorant people still use void main , which is NOT encouraged.)
Whereas Java's main code is always inside of a class, and looks like this:
public static void main() { }
Of course the code you posted was not *real* Java, as it did not use any braces. But you get the idea.
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339