Story Transcript
MAGAZINE
COLLECTIVE REFLECTION
LEARNING QUEST C BEYOND THE PROGRAM JAN CELINE RASCANO APM 1103 SEC 1
CONTENTS 1 3 5 8 11 14 16 19 22
C
BEYOND
THE PROGRAM
INTRODUCTION TO
C
PROGRAMMING
MY
EVER PROGRAM
32
MAT-ISH CODES
MACHINE
WHAT
2
MACHINE 3
IF-CEPTION
MACHINE PROBLEM
35 38
IF?
PROBLEM
27 30
FIRST
PROBLEM
25
4
42 44 47
KISS:
KEEP
SHORT
IT
AND
SIMPLE
52
MACHINE PROBLEM
5
LIGHTS
ON
LIGHTS
OFF
OR
MACHINE PROBLEM
HULA
6
HOOPS
MACHINE PROBLEM
7
LOOP-CEPTION
MACHINE PROBLEM
49
8
FUN-CTIONS
54 57 69 72
MACHINE PROBLEM
9
ARRAY COUP
OH
MACHINE PROBLEM
10
RATING: 9
HABITS
CLOSING REMARKS
CONTRIBUTORS
C
BEYOND THE
PROGRAM
MY LEARNING JOURNEY:
HOW IS IT LIKE LEARNING C PROGRAMMING?
1
JATRIX MAGAZINE PRESENTS...
SEEING FURTHER THE CREATION OF EVERY PROGRAM IN THIS MAGAZINE, I SHARED MY EXPERIENCES, ACQUIRED KNOWLEDGE, AND REFLECTIONS ABOUT MY LEARNING JOURNEY IN C PROGRAMMING LANGUAGE. YOU ARE GOING TO SEE BEYOND EVERY PROGRAMS THAT I MADE THROUGHOUT THE ENTIRE SEMESTER.
2
WEEk 3
Introduction to to to
C C PROGRAMMING PROGRAMMING On our first day of class, we started off by the introduction
of
C
programming.
We
studied
the
fundamental structures, syntax, and functions of basic
codes
that
are
very
crucial
in
our
next
programs. Mr. Andaya, our professor in our subject Fundamentals of Computing 1, tackled about the various backlash
escape (\)
sequences
and
usually
which
followed
start by
a
with single
character or sometimes even more. Each escape sequence denotes their own representation and meaning. machine program
Our
professor
problem that
will
sequences that we
and
he
then asked
gave us
to
the
first
make
a
#include display the different escape main() { learned. printf("\n\tGoodbye World"); getch(); }
3
r s i f tm BY FAITH MARIE
oblem pr
i h n c e a
TOXIC THOUGHTS
4
\n\t MY FIRST EVER
Program
"THE FIRST TIME YOU DO A THING IS ALWAYS EXCITING."
-AGATHA CHRISTIE
5
As
I
mentioned,
program
that
our
will
first
show
task
the
was
lyrics
to
of
create
our
a
favorite
song on the output which will display the different escape
sequences.
The
first
Machine
Problem
is
very special for me because this is the first ever program that I made in C Programming Language and it became even more remarkable since I got to feature the lyrics of one of my favorite songs which is entitled "Toxic Thoughts" by Faith Marie. A bit of anecdote: during high school, I only had studied the basics of web development. I did not really study any programming language so this was really my first time creating a program. I felt the excitement and urge of
urge of pouring my best effort into this
activity ever since Mr. Andaya gave this task to us. I gave
my
best
to
think
of
different
designs
and
layout that I could use. In this activity, the escape sequences that I often used was the "\n" and "\t". I definitely however,
enjoy it
was
our a
bit
First
Machine
tiring.
I
had
Problem;
to
think
of
combinations of colors that will match to the mood of the lyrics and I also had to listen to the song over and
over
synchronized
again
so
with
the
the song,
display but
the
would good
be thing
about it was that, it was my favorite song being
6
listened numerous times so it became less tedious to do the task.
OUTPUT OF
Machine Problem 1
7
MATH–ISH CODES WEEK 4
THE BUILDING BLOCKS KEYBOARD INPUT, VARIABLE, DATA TYPES, AND ARITHMETIC OPERATORS
8
In this week's lesson, Mr. Andaya tackled about keyboard input, variable, data types, and arithmetic operators.
fn
ca
understand and remember. In keyboard input, there is a function that reads formatted input and that is called scanf(). Variable is an identifier that is used to hold and alter the value held within them. During program execution, the variables can change. It
Most of these things are being associated with mathematics stuff that we have learned before, making this programming lesson easy to
9
depends on the programmer on how he/she will manipulate those variables, and that's where the significance of data types and arithmetic operators will come in. The classification of data is represented by data types. It can be integer, long integer, float, double, or character. On the other hand, arithmetic operators are nothing new to me because I've been using them since I was in elementary. Addition, subtraction, multiplication, and division are the four operations that I am sure we are all familiar with.
10
2nd Machine Problem We are asked to make a conversion calculator that will convert units in mass, length, or volume. We had to choose two metric systems and choose units from them. Lastly, we were asked to interchange the values of the converted units of the two chosen metric systems. To be frank, the 2nd Machine Problem was the easiest for me.
11
It did not even take me much time compared to the first Machine Problem. I enjoyed doing this and I thought I would get another perfect score which would follow the first one, but it wasn’t the case. In my surprise, this was where I got the lowest grade so far. It is for the reason that I did not clearly understand what Mr. Andaya said about the interchanging of values. I wasn't yet aware that I should make another variable in order for the previous one to be stored in it. I thought I was just going to literally interchange the preexisting variables. Indeed, mistakes are really
12
opportunities to learn. Hence, I learned my lessons that I should clarify things first before applying them in my programs.
Output of the Machine Problem
13
HERE IS ANOTHER EPISODE OF
WEEK 5:
IF STATEMENTS IF-ELSE IF-IF IF-ELSE-IF
14
If statement was our lesson for 5th week. The if statement is used in conjunction with a condition and it is also in charge of changing the flow of execution of a program. Before executing any statement within the body of if, the condition is evaluated first if it is true or false. Single instruction or block of code is usually surrounded by curly braces. In my preference, I usually use curly braces especially when the instructions are long because I could better understand the groupings of codes that way. Other than if statements, our professor also discussed about the conditional operators, and those are