Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
STATE
UNIVERSITY
ILIGAN
INSTITUTE
OF
TECHNOLOGY
CSc
101
(Introduction
to
Computer
Programming
I)
MACHINE
PROBLEM
SET
#
1
Released:
July
6,
2014
(09:50
PM)
Instructions
and
Ground
Rules:
1. Please
follow
all
the
rules
and
instructions
for
this
machine
problem
set.
All
violations
are
subject
for
corresponding
point
deduction
on
the
students
attained
points.
2. Source
code
files
must
have
a
*.c
extension
(i.e.
my_file.c).
Library
code
files
(if
tasked
to
be
written)
must
be
in
*.h
extension.
3. Submitted
source
code
files
must
be
properly
commented
with
the
students
name,
ID
number,
section
and
date.
4. Files
must
be
of
format
as
follows:
<LAST_NAME>_<ID_NUMBER>_MPS1_<SINGLE_COMMENT>.<EXTENSION>
So,
say
you
have
a
*.c
source
code
and
it
is
the
main
program
you
can
have
as
Bandiola_2009-0661_MPS1_problem1.c. Should
there
be
no
comment
on
your
file,
just
put
it
as
Bandiola_2009-0661_MPS1.c. You
can
have
as
many
files
as
you
want
as
long
as
it
is
necessary
to
solve
the
problem.
5. STRICTLY
NO
COPYING
of
source
codes
from
other
sources
(i.e.
classmates,
internet,
friends,
etc).
You
may
discuss
your
answers
with
your
classmates
and
further
explore
other
learning
opportunities
while
doing
this
machine
problem
set,
but
do
not
cheat
on
this.
(P.S.
I
know
what
a
copied
code
looks
like,
so
beware!)
6. Every
machine
problem
must
be
on
their
respective
source
code
file.
7. SUBMISSION
would
be
on
July
14,
2014
at
11:55
PM.
Late
submissions
will
not
be
considered,
period.
Send
your
submissions
to
kiethmark.bandiola@g.msuiit.edu.ph
only,
with
subject
MACHINE
PROBLEM
SET
#
1.
MACHINE
PROBLEM
#
1:
Difficulty:
EASY
(worth
20
points)
Rankine
is
a
rarely
used
temperature
scale
that
was
proposed
in
1859.
The
formula
for
Rankine
given
a
value
in
Celsius
is
as
follows:
Ra = C 1.8 + 491.67
Write
a
program
that
gives
the
value
of
a
certain
temperature
in
Rankine
(Ra)
given
a
certain
temperature
in
Fahrenheit
(F).
Your
program
must
be
interactive
such
that
your
program
will
ask
for
the
value
of
the
temperature
in
Fahrenheit.
Additionally,
your
program
must
utilize
functions
such
that
given
a
value
in
Fahrenheit;
it
will
return
the
value
for
Rankine.
MACHINE
PROBLEM
#
2:
Difficulty:
EASY
(worth
20
points)
Given
your
program
in
Machine
Problem
#1,
change
your
program
such
that
the
input
of
your
program
is
in
Kelvin.
Same
rules
apply
from
the
first
problem.
MACHINE
PROBLEM
#
3:
Difficulty:
MEDIUM
(worth
30
points)
In
basic
algebra,
the
quadratic
formula
is
the
solution
of
the
quadratic
equation.
There
are
other
ways
to
solve
the
quadratic
equation
instead
of
using
the
quadratic
formula,
such
as
factoring,
completing
the
square,
or
graphing.
The
quadratic
formula
is
defined
as
follows:
! 4
=
2
For
this
problem,
make
a
program
that
given
three
values
a,
b
and
c,
the
program
will
return
the
value
of
x.
Lets
assume
that
the
value
of
! 4
is
positive.
Your
program
must
utilize
both
user-defined
and
math
functions.
Additionally,
it
must
be
interactive
such
that
your
program
will
ask
for
the
values
of
a,
b
and
c.
MACHINE
PROBLEM
#
4:
Difficulty:
MEDIUM(worth
30
points)
A
six-meter-long
ladder
leans
against
a
building.
If
the
ladder
makes
an
angle
of
60
with
the
ground,
how
far
up
the
wall
does
the
ladder
reach?
How
far
from
the
wall
is
the
base
of
the
ladder?
Round
your
answers
to
two
decimal
places,
as
needed.
Make
a
program
that
will
solve
this
problem.
Machine Problem #1 | CSc 101 (Introduction to Computer Programming I)
kiethmark.bandiola@g.msuiit.edu.ph