<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Khan Zai</title>
    <description>The latest articles on DEV Community by Khan Zai (@khanzai).</description>
    <link>https://dev.to/khanzai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4187189%2Fd71f7cc2-227e-4e5b-afec-1b0ec5daecb2.png</url>
      <title>DEV Community: Khan Zai</title>
      <link>https://dev.to/khanzai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khanzai"/>
    <language>en</language>
    <item>
      <title>How I Built a Free Army Fitness Test Score Calculator with Vanilla JavaScript</title>
      <dc:creator>Khan Zai</dc:creator>
      <pubDate>Thu, 15 Oct 2026 16:45:11 +0000</pubDate>
      <link>https://dev.to/khanzai/how-i-built-a-free-army-fitness-test-score-calculator-with-vanilla-javascript-40l8</link>
      <guid>https://dev.to/khanzai/how-i-built-a-free-army-fitness-test-score-calculator-with-vanilla-javascript-40l8</guid>
      <description>&lt;p&gt;I recently built a free Army Fitness Test score calculator as a static website. It is a small project, but it touches several ideas that come up in real front-end work. Here is how I put it together.&lt;/p&gt;

&lt;h2&gt;
  
  
  The five events
&lt;/h2&gt;

&lt;p&gt;The Army Fitness Test (AFT) has five events: the 3-repetition maximum deadlift, the hand-release push-up, the sprint-drag-carry, the plank, and the 2-mile run. Each event is scored from 0 to 100 points. To pass, a soldier must score at least 60 points in every event and reach a minimum total of 300 out of 500 points. Those two rules drive the whole calculator.&lt;/p&gt;

&lt;h2&gt;
  
  
  A canonical data layer
&lt;/h2&gt;

&lt;p&gt;The heart of the project is the scoring data. The official AFT scoring tables map a performance value, like a deadlift weight or a 2-mile run time, to a point score for each event. I keep all of these tables in one canonical data structure near the top of the script. That separation matters. If the official tables ever change, I only edit one place. The rest of the code never hard-codes a number.&lt;/p&gt;

&lt;h2&gt;
  
  
  A pure scoring function
&lt;/h2&gt;

&lt;p&gt;Above that data layer sits a single pure scoring function. It takes an event name and a raw performance value, looks up the matching row in the table, and returns a score between 0 and 100. No DOM access and no side effects. That purity makes the function easy to test. I can feed it sample performances and assert the returned scores without rendering anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Form inputs per event
&lt;/h2&gt;

&lt;p&gt;The page has one form input per event. Each input handler reads the value, passes it to the scoring function, and renders the per-event score. The total updates live as the user types. Keeping each input independent means one invalid value never breaks the others. The pass or fail message applies the 60 per event and 300 total rule and changes color accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Score history with localStorage
&lt;/h2&gt;

&lt;p&gt;After a full result is computed, the calculator saves the total and the date to localStorage. On load it reads the history back and renders a simple table of past scores. This gives returning visitors a training log with zero backend. The lesson for a static site is that browser storage is enough for personal history features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a static site
&lt;/h2&gt;

&lt;p&gt;The whole calculator is a static site. There is no server, no database, and no build step beyond plain files. That keeps hosting free and the page fast. All logic runs in the browser, so the page stays responsive and easy to deploy anywhere.&lt;/p&gt;

&lt;p&gt;You can try the finished calculator here: &lt;a href="https://www.armyfitnesstestcalculator.com/" rel="noopener noreferrer"&gt;https://www.armyfitnesstestcalculator.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not affiliated with the U.S. Army.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>html</category>
    </item>
  </channel>
</rss>
