Your question is also not very clear. Is the user going to be typing how many sips that have been taken?
There is too much ambiguity in your question for anyone to go with, and referring to @Nepomuk's post, no one will simply write a class for you.
I will try to help you, simply.
- boolean open = false;
-
int sip = 5;
-
-
If (open = false)
-
~WriteSomething "The can is unopened"
I'm going to leave the "sip" function up to you because I'm not sure how to handle it because of your lack of clarity in your OP. I think you know how to do it, just give it a try. If you fail, Google what you think you are doing wrong, and try it again.
What will happen (aside from your homework not being turned in on time) ? The computer will burst in flames and everyone will laugh? No. How else will you learn?