Jump to content



Photo
- - - - -

Creating A Program For A Formula That I Made


  • Please log in to reply
1 reply to this topic

#1 sthrnrdsx

sthrnrdsx

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 11 November 2008 - 02:59 AM

Ok, so today in my Calculus class I came up with a formula that amused all my friends (it predicted their death to the minute, based completely on some statistics that were provided to us via a random scatter plot that our teacher assigned us). I don't think the formula is necessary for you guys to help me however. I need your help to create a program that would allow the users to simply input their birthday and the calculator would use my formula to predict their death day. Just to let you know, this formula does not include certain variables such as homicide, suicide, or disease. This is based purely upon average life-spans for certain age groups. I would like to have this as soon as possible so that more of my friends can try out the program quickly, without waiting for me to do all the calculations with worry of messing it up somewhere in the process. I know this is a lot to ask of you, especially since I am new here, but I have faith that someone that looks at this topic will be able to help me out. (I do not need this tomorrow, however, I would like to have the program written out on here by at least Friday) If you do need the formula in order to create program I will gladly give it out, as I do not care if you enjoy playing with it as well.

Formula:
y=(-0.8544047)(age)+74.2357142

In order to get the decimal form of the age, subtract the day of the year they were born on (for instance, if they were born on July 13th, it would be 194) from the day today is (for example, today, the 10th of November is day 314 of the year, (please check this as I am very tired and cannot think correctly)). Thus giving the day portion of their age (314-194=120). You then divide the day, 120, from how many days there are in a year (since every 4 years is a leap year I used 365.25 as the amount) Thus giving us 120/365.25=0.3285420945. You then add their current year age to this (if they are 22, add 22 to 0.3285420945) and place that in the formula above to determine how many years from now they will die. You then can figure out how to manipulate the numbers that you get to determine down to what minute the person would die, you can even take it as far as the millisecond (which I refused to do).

Knowing all this, can someone please help me create said program? Do not criticize my math, as I am well aware that it may not be correct, because this formula is a mere joke amongst my friends and is used to have fun determining who among us will die first and we try to determine who we believe would be the "murderer".

This may seem psycho to you all, but this is how my friends and I roll. Thank you for reading all of this, good night, and good luck to you all.

#2 IbmPad

IbmPad

    Casio Fan

  • Members
  • PipPip
  • 35 posts
  • Location:France
  • Interests:- Programming (PC and Calc)<br />- Old calculators<br />- Piano<br />- Foreign languages

  • Calculators:
    CP-330 / FX-9860G SD / HP-49G+ / HP-48G / AFX 2.0+ / FX-795P / FX-4500P / FX-8500G/ FX-4000P / FX-602P / FX-7000G / FX-6800G / FX-702P / PB-700 / Sharp PC-1403 / Электроника МК-61 / TI-57 II / FX-180PV / FX-82 / FX-82D / FX-92

Posted 11 November 2008 - 09:21 PM

Hello, I do not ask me about this formula  :greengrin: , I have just made the program from the algorithm !
So it must be something like this (I am not sure) :
"Birth Day"?→A
  "Birth Month"?→B
  30.5(B-1)+A-1→C
  "Today Day"?→A
  "Today Month"→B
  "Age"?→F
  30.5(B-1)+A-1→D
  Abs (C-D)÷365.25+F→E
  -.8544047×E+74.2357142→G
  Int (Frac G×365.25)→H
  Int G→G
  ClrText
  Locate 1,1,G
  Locate Int log G+3,1,"Years and"
  Locate 1,2,H
  Locate Int log H+3,"Days"



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users