473,473 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calculating Mile splits, Calculation error in the work.

2 New Member
Expand|Select|Wrap|Line Numbers
  1.  
  2. mile1smin=mile1min;
  3.  mile1ssec=mile1sec;
  4.      mile1shun=mile1hun;
  5.  //first set of hundreds
  6.      mile1sminsec=mile1smin*60;
  7.      mile1sminsechun=mile1sminsec*100;     mile1hundreths_total=mile1shun+mile1sminsechun;
  8.  //second set of hundreds
  9.      mile2sminsec=(mile2min*60)+mile2sec;     mile2sminsechun=mile2sminsec*100;     mile2hundreths_total=mile2sminsechun+mile2hun;
  10.  //third set of hundreds
  11.      mile3sminsec=(mile3min*60)+mile3sec;     mile3sminsechun=mile3sminsec*100;     mile3hundreths_total=mile3sminsechun+mile3hun;
  12.  
  13.       mile12split_total_hun=mile2hundreths_total-mile1hundreths_total;     mile23split_total_hun=mile3hundreths_total-mile2hundreths_total;
  14.  
  15.       mile2ssec=mile12split_total_hun/100;
  16.      mile2ssecm=mile2ssec%100;
  17.      mile2smin=mile2ssecm/60;
  18.      mile2sminm=mile2smin%60;
  19.  
  20.       mile3ssec=mile23split_total_hun/100;
  21.      mile3ssecm=mile3ssec%100;
  22.      mile3smin=mile2ssecm/60;
  23.      mile3sminm=mile2smin%60; 

Variables Used
Expand|Select|Wrap|Line Numbers
  1.  
  2. int runner_number;
  3.      int mile1min, mile2min, mile3min, mile1sec, mile2sec, mile3sec, mile1hun, mile2hun, mile3hun;     int mile1smin, mile2smin, mile3smin, mile1ssec, mile2ssec, mile3ssec, mile1shun;
  4.      int mile2sminm, mile3sminm, mile2ssecm, mile3ssecm; 
  5.     int mile1sminsec, mile1sminsechun, mile2sminsec, mile2sminsechun, mile3sminsec, mile3sminsechun;
  6.      int mile1hundreths_total, mile2hundreths_total, mile3hundreths_total;
  7.      int mile12split_total_hun, mile23split_total_hun;

In my calculations, When I input the numbers that I have set for my hundreds value, My Second value, And my Minutes value something goes horribly wrong and it defies all reasoning in my head. Please, Can anyone inform me as to what i am doing wrong, or the parts i am missing.

-D
[P.S. - THANK YOU!]
Sep 25 '08 #1
2 1424
boxfish
469 Recognized Expert Contributor
Could you please explain more about what you're trying to do? I can't tell which variables are for the input, which are for the result, and what exactly you're trying to compute.
Sep 25 '08 #2
Dameon Vanscyoc
2 New Member
Sorry, I've figured it out, The problem was that my variable was being odd and wouldn't let me display it as the number i wanted to, It was a personal error.

thank you however for reading it.
Sep 26 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Ron Adam | last post by:
Hi, I'm having fun learning Python and want to say thanks to everyone here for a great programming language. Below is my first Python program (not my first program) and I'd apreciate any...
13
by: | last post by:
I have an Access database used to track donor pledges. In it, there is a table that contains three fields for each donor: Gift_Amount, Gift_Per_Year, and Matching_Gift_Ratio. The following...
2
by: kuhni | last post by:
Hi everybody! After searching newsgroups for a couple of hours, I now try asking directly (running the risk of asking again the same question). My problem is to predict when the size of the...
5
by: sugaray | last post by:
Hi, my problem with calculating the size of an array is when I pass an array as a parameter to a function which perform the calculation, the result never comes right, like below: int...
10
by: tkq | last post by:
I have a normal table with customer information I have a DoB field and I want to have an automatic calculation that will show the age of the customer in another field next to it called Age ...
5
by: Stewart | last post by:
Hi there, I would like to calculate a person's age in years (between 2 dates). I am using the following function for this calculation (source: http://www.mvps.org/access/datetime/date0001.htm)...
5
by: jonm4102 | last post by:
I'm trying to calculate the median of some numerical data. The data can only be found in a query (henceforth query 1) field I previously made, and I would prefer to calculate the median in a new...
5
by: steve | last post by:
Hi All Not sure if this is the right forum, but I need the formula for calculating the amount of Sales tax (GST) from the tax included price In Australia GST is 10% and the standard formula is...
10
by: Lisa | last post by:
In translating the formula for calculating lottery odds for various conditions into a Visual Basic Program, I have apparently missed something in that I get errors in the part of the calculation...
10
by: Joseph Geretz | last post by:
I need to calculate miles per degree longitude, which obviously depends on latitude since lines of longitude converge at the poles. Via Google, I've come up with the following calculation: ...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.