Saturday, April 18, 2015

Blog #9: C is for Computer Programming

Basic Programming Using the C Programming Language


     This was not my first time to encounter computer programming. But I was not an expert, actually the opposite. When I was in my 2nd year of high school, we had a programming subject where we learned HTML, CSS and Java. I passed the subject, but to be frank, I had little to none info retained in my brain -_- I survived merely by asking my classmates for some help, and probably our teacher curved our grades. Heehee. I do remember a few things from html though, the "marquee" and the "blink" :P

     The second time I encountered programming was here in college. I mentioned last time that I had a subject named AMAT 150 (Computer Programming), where we used Plato IDE and the Fortran Programming Language (that's probably jurassic programming), where I learned a lot and enjoyed so much though it was as tedious as any other subject. The semester after that, we had MATH 174 (Numerical Analysis 1) where we used Scilab. Scilab is an open source software and is widely used in secondary and higher education institutions for teaching mathematics, engineering sciences and automatic control engineering (from http://www.scilab.org/). We also made codes that help in solving various mathematical problems (trust me, you wouldn't want to know), which is why AMAT 150 is its prerequisite. Though I have enjoyed AMAT 150 so much, what I felt with MATH 174 was actually the opposite, that I almost failed the subject, thank God I did not! The codes were too hard for my brain to comprehend, and probably because 15 units out of my 18 units were majors and electives that my brain chose not to work anymore. LOL. It was too mathematical and theoretical, and yet we fuse programming with it, so how on earth o.o

http://www.quickmeme.com/meme/3rf9j4

     C programming was fun and easy to understand, also because I had a little background on programming, and already encountered if-else, etc.

     Okay so here are some screen captures of the exercises we did in our laboratory class. The text editor (white) is where we input our commands using the c language, and the terminal (black) is where the commands are executed.

Program that prints "Hello World!"

Program that gets the sum of 2 and 5

Program that gets the sum of two numbers (integer and decimal)


Program that gets the sum of two numbers, and the difference of the two numbers if the sum is less than 200 (otherwise, "Gravity ang laki ng sum!" will be printed)

Program that computes for the GWA from the given subjects, and prints PASS if GWA is less than 3.0, otherwise prints FAIL

No comments:

Post a Comment