My First Coding Project
- Pei
- Jul 1, 2021
- 3 min read
Wassup y'all! I rarely mention about anything beyond A-levels on this blog, but now that I'm stepping into another phase of my life, I figured I could throw all my Chemistry and part of my Physics knowledge to the wind. I applied for Computer Science, but as of now, I'm not at all what somebody would call 'tech savvy', which makes the prospect of starting uni pretty daunting.
Strictly speaking, my very first 'culture shock' was when I was 16, while participating in a certain competition in a certain state in Malaysia. It came as a shock to me that there's a huge field out there that I was very much unexposed to, and how my peers from other backgrounds are so adept at it. So yes, we failed that module spectacularly with a faulty robot. The next year, no more shock, but rather more interest. With a more planned-out teaching, at a certain camp in Singapore, that was a game-changing experience for me. It was just a very basic encounter, using block coding and microbit (which was really cute).
Back to the point, my first coding project. There's something called a MetS score, which I forgot what it stands for, but anyway, sometime back in January, my mom wanted a way to calculate that score automatically because, well, the formula goes something like this:
-8.5245+0.0156*FPGc+0.0089*SBP+0.0371*WC-0.0182*HDLc+0.7913*log(TGc)
Which varies for male and female. (Those weird letters are the patient's data) Not to mention all the data needs conversion of units. For a mother who does research, the next logical thing to do while any tech problems arise is to go to her girl who's potentially going to learn how to automate things. So I formatted a Google Spreadsheet pretty quickly, but I felt like I wanted to create a UI for this. (I used Java)
I know this doesn't sound very right, but I ignored about 2 days of classes for this, and sat there trying to create and export my UI right till midnight, for 3 days straight. Although it was nothing very cool (quite lame in fact), I couldn't help feeling proud of my small, little accomplishment. Everyone's got to start somewhere, don't we.

Basically, there's a toggle for you to choose the gender, then you input all the data (which I don't know what it means, but for those of you who want to study medicine it's probably good to look it up for some extra knowledge) and hit the calculate button. Well, it's pretty self-explanatory. But it took a whole lot of work to create it for someone who hasn't much prior knowledge.
After a lot of youtube, stack overflow, hours in front of the laptop and a whole lot of trial and error, this was what I got.


Then I spent more time trying to learn how to export the project out of the IDE, to make it executable. There was a problem that I couldn't solve even after many many tries, which was that I couldn't bundle the JRE together with the app to export the whole app to another computer. The antivirus keeps deleting it. Now if I wanted to launch this calculator on another computer, I'd have to send the whole JRE file to the computer (or download it online), if it doesn't have Java installed. Someone help. Do leave a message if you know how. Many thanks UwU.
That concludes my little adventure, and I felt that it was worth 10 Chemistry lessons (I love my Chemistry lecturer I just don't like the subject) . I think I'd be doing more projects before I start uni, and definitely much much more to come once I do. Maybe the fun will wear off once the stress comes in, but I'll be enjoying it while I can.
~Carpe diem~
Comments