CCC101 If Else Switch
CCC101 If Else Switch
>=60 >=60
1.Read input from user (it's grade) 1.Read input from user (it's grade)
TRUE FALSE
SMVC MSU- IIT-CCS-CA
GIVEN THE CONDITIONS, HOW
WILL YOU WRITE THE CODE?
>=60 >=60
1.Read input from user (it's grade) 1.Read input from user (it's grade)
TRUE FALSE
SMVC MSU- IIT-CCS-CA
SMVC MSU- IIT-CCS-CA
C RELATIONAL OPERATORS
THERE MAY BE TIMES THAT THE CONDITION IS TRUE JUST FOR A SINGLE VALUE
Grading System
A: 90-100
Print the range of
B: 80-89 values associated
D: 60-69
letter.
F: 0 - 59
SWITCH-CASE
Grading System
A: 90-100
B: 80-89
C: 70-79
D: 60-69
F: 0 - 59
SWITCH-CASE
Grading System
A: 90-100
B: 80-89
C: 70-79
D: 60-69
F: 0 - 59
SWITCH-CASE
SHORT QUIZ
CCC 101
INTRODUCTION
GENERAL
CONCEPT
Prepared by
END-USER
end-user refers to a user who is interested only in
running simulations and analyzing data
DEVELOPER
developer refers to one who wishes to modify code
and/or develop new code.
Link 1
http://www.codeblocks.org/downl
oads/binaries/#imagesoswindows
48pnglogo-microsoft-windows
customer
waiter
SMVC MSU- IIT-CCS-CA
UNDERSTANDING WHAT IS A
PROGRAMMING LANGUAGE
TRANSLATING
TO FRENCH
I want to get
croissant and
coffee.
TRANSLATOR
GUY
waiter
SMVC MSU- IIT-CCS-CA customer
UNDERSTANDING WHAT IS A
PROGRAMMING LANGUAGE
Translating to
Machine
Language
TRANSLATOR
input GUY
HELLO WORLD!
Print:
"HELLO WORLD!" OUTPUT
keyboard
Programming
Language
DISPLAY
SMVC MSU- IIT-CCS-CA
C Programming
You may use your LAB time to study and implement your
codes. I've already spoken with Sir Ervin about opening
the IOT Lab on Mondays from 2:00 p.m. to 5:00 p.m.
CCC 101 B182 AND B182.1
Using Desktop
Laptop
Tablet
Smart phone
Using friend's computer
From Internet Cafe
Computer laboratory
etc..
QUESTION
REMEMBER
AN ALGORITHM IS A STEP-BY-STEP PROCEDURE TO SOLVE A GIVEN PROBLEM.
ALGORITHM
1. GO TO WWW.FACEBOOK.COM
2. ENTER E-MAIL ID AND PASSWORD
3. CLICK ON LOG IN BUTTON
INPUT/OUTPUT DECISION
CONTROL FLOW
I/O OPERATION I.E. TAKING INPUT AND USE FOR ASKING QUESTIONS THAT CAN HAVE
EITHER TRUE OR FALSE (YES OR NO) SHOW THE DIRECTION FLOW
SHOWING OUTPUT
AS AN ANSWER
ALGORITHM
1. GO TO WWW.FACEBOOK.COM
2. ENTER E-MAIL ID AND PASSWORD
3. CLICK ON LOG IN BUTTON
ENTER
1. INITIALIZE SUM=0 (PROCESS) 10,20
2. ENTER THE NUMBERS (I/O)
3. ADD THEM AND STORE THE SUM=10+20
RESULT IN SUM (PROCESS)
PRINT
SUM
STOP
FLOWCHART EXERCISE
NO
COMMENTS
BALIKBAYAN
3.BOX CONTENT
3. BOX ADDRESS
FOOD STORAGE BOXES
VARIABLES
1.VARIABLE "Creation"
age
int age;
temp
double temp;
2.Structure in C language
int age;
30
age=30;
80
int grade1;
int grade2;
grade1=80; 100
grade2=100;
printf("Average = %d\n", (grade1+grade2)/2);
READING INPUT FROM USER
VARIABLE AS INPUT
1.Reading data from user
80
2.Structure in C language (using scanf)
int grade1;
int grade2;
scanf("%d",&grade1); 100
scanf("%d",&grade2);
Write a program that will print on the screen the results of 5 mathematical operations:
Addition (+)
Subtraction (-)
Multiplication (*)
Division (/)
Remainder (%)
1. Write a program that gets from the user a temperature ("double") in Celsius degrees.
The program should calculate and convert the temperature from Celsius degrees to
Fahrenheit degrees and print it.
2. Write a program that gets from the user a temperature ("double") in Fahrenheit
degrees. The program should calculate and convert the temperature from Fahrenheit
degrees to Celsius degrees and print it.