Ok so I am trying to use a try catch to handle error in this simple gas mileage calculator. When I enter some number that are not in the error handeling like
gas = 8.97
begning miles = 853
end miles = 1235
it gives the right result so thats fine, but when I enter 0 for gas or for end miles it...
Ok I think I got this figured out with Environment.TickCount
But now I am having a problme with testing it. I am trying to print out the time played here with this line but it prints out this
Time played = {0}
i want it to print out the mills value what is wrong with it...
Ok I got it working, i feel kinda stupid this look like a noob mistake, but hey I am one so :)
but here is how to fix this problem
int gInput = Integer.parseInt(gas.getString());
int bMInput = Integer.parseInt(bm.getString());
int eMInput = Integer.parseInt(em.getString())...
ok so I want to get input from the user for ending and begining mileage of a car and how much gas that is used during the travle.I got the input boxes set up that works fine but when I try to convert them to ints it does not what I am I doing wrong here?
import javax.microedition.midlet.*...
I see, does anyone know o a nother way to get a timer in the code, I was just follwoing a book and it does not have any ting else in it about seeing how long a program takes to run.
According to this resource http://dotnetperls.com/stopwatch
the stopwatch class is in the using System.Diagnostics. Which i think I imported correctly. Am i using it wrong in the code did I create it in the wrong place?
ok so I am trying to get this game to have a timer and I got it down to the stopwatch thing but Visual Studio 2005 says that
"Error 1 The type or namespace name 'Stopwatch' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Kakashi\Documents\Visual Studio...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.