It's not really clear what your problem is. If it's that you're trying to turn the user's input "milk" into the local variable milk, you can't do that directly. You can do something like:
This approach is not scalable or flexible though. Without knowing what your exact assignment is, or what you're learned so far and are allowed to use, or what concept is being tested here, it's hard to advise any particular approach.
Joined: Sep 05, 2012
Oh, sorry for not being able to express my query accurately =/
The actual question is " Assuming that you are asked to calculate the GST ( 7% tax) of a product given the price. The formulae would be : gst*0.07.
In addition to what Winston says, when you do start coding, start small. Start as small as you need to to get it to compile and run. Maybe that means you start with:
and after that you add just enough code to calculcate the tax on a hardcoded value. And once you get that working, you move on to taking user input or summing up totals or whatever else you need to do. But at each step, you start with a working program and add just a little bit to it and get that program working before moving on. Don't be afraid to write separate, small, throw-away programs to test a concept by itself, without the clutter of the other stuff you've done so far. I've been programming professionally for possibly longer than you've been alive and I still do that all the time.