Sunday, September 27, 2009

C Program using Conditional Statements

Problem:

XYZ Company gives year-end bonus to its employees based on their number of years of service and their salary, using the following:

Years of Service wwwwwwwwwwwwwwwwwwwwwBonus

1 wwwwwwwwwwwwwwwwwwwwwwwwwwwwww10% of Salary
2 to 4 wwwwwwwwwwwwwwwwwwwwwwwwwwww20% of Salary
5 to 10 wwwwwwwwwwwwwwwwwwwwwwwwwww50% of Salary
11 and above wwwwwwwwwwwwwwwwwwwwwww 75% of Salary

Program:( Click the image to enlarge)

Labels:

Planetarium Zero-Zero

I know lots of people go to SM Mall of Asia in Pasay City to go malling. But only a few could go sleeping in MoA.

And by chance, we are one of those.

Anyway the story was like this. We had our National PSYSC Science Olympiad Finals sa Nido Fortified Science Discovery Center sa Entertainment Mall nang nagsimula ang hagupit ni Ondoy. Then the MoA people advised the PSYSC facis not to permit us to go back to our residences dahil naging ilog na yung mga daan, like Roxas Boulevard, EDSA, the like.

So, all of us (about 250 heads), including the participants, coaches, parents and the facis, plus the SDC staff, stayed on MoA.

At anong ginawa namin? Most went to the Planetarium, dahil binigyan kami ng free movie marathon for about four hours, then sleeping time after that. Nakatutok naman yung iba sa TV (yung iba sa projector screen sa Events Center) to watch news updates about the typhoon. At yung iba, natulog na lamang, hoping na sana makakauwi na the morning after.

And so it was. Most of us went home the morning after. We went out in MoA at exactly 0600.

So three lessons learned on this funny yet once-in-a-lifetime (?) experience:
  1. Stay calm.
  2. Enjoy the place.
  3. Eat well.

"Cabin crew, prepare for take-off."





smsanch >

Wednesday, September 23, 2009

Sample C Program on Conditional Statements

Problem:

Write a C program that finds the smallest among the five integers inputted by the user.

Program: (click the image to enlarge)


Labels:

Friday, September 18, 2009

C Programming Lesson - Conditional Statements

Chapter 8

Conditional Statement
(Click to to view the presentation)



Labels:

Wednesday, September 16, 2009

C Program that accepts a person's name

Try this in your home!

#include"stdio.h"
#define p printf
main()
{
int age;
char name[10];
clrscr( );
p("\n Enter name:");
scanf("%s",&name);
p("\n Enter age:");
scanf("%d", &age);
p("\n Hello %s, you are %d years old", name, age);
getch();
}

Labels:

Monday, September 14, 2009

FLowcharting Problem Given to Class Del PIlar

Given to numbers x and y, draw a flowchart to determine the difference between x and y. If x-y is negative, compute R=x+y; if x-y is zero, compute R=2x+2y; and if x-y is positive, compute R=x*y. Print the values of x,y, and R.

Answer (click the image to enlarge).

Labels:

C Programming Lesson - Input and Output Statement

Chapter 8

Input and Output Statement

(Click to view this presentation.)


Labels:

Sunday, September 13, 2009

Modern Warfare 2

See for yourself.


smsanch >

Saturday, September 12, 2009

Michael Jordan Talks to ESPN as Hall of Famer

Labels:

A Simple C Program - Hello World


A Simple C Program:

#include"stdio.h"
#define s scanf
#define p printf
main()
{
int x, y;
clrscr( );
p("Hello World.\n");
s("%d %d",&x,&y);
x=x+y;
p("The final value of x is %d.",x);
getch();
}

Labels:

Thursday, September 10, 2009

Helppp

ANNONSER: Kailangan ng TCNHS Website Team ng mga bagong contributors para sa pag-update ng website, most especially sa mga latest news.

Don't worry kung inaakala n'yo ay mahirap itong trabaho. You will just be making articles in Word (or any word processing prog) and we'll be the ones (smsanch and SiR eRnz) to post your updates.

If you do respond to this call, your name will be posted on the website plus you will have free access to more help and IT support. Just contact either me or siR eRnz if you want.

Takk!



smsanch >

Flowcharting: Group VI Del Pilar


smsanch >

Labels: , , , ,

Tuesday, September 08, 2009

Lesson C Programming - Structure of Simple C Program

Chapter 7

Structure of a Simple C Program
Click the link above to view the presentation.

Have a nice day!

Labels:

Flowcharting: Group 1 del Pilar

Draw a flowchart that displays 3 inputted numbers in ascending order. Use repetition control structure.

Click the flowchart to enlarge.




Labels: , , , ,

group 4 -delP

Click the flowchart to enlarge.

Labels: , , , ,

GROUP 2 - DEL PILAR


Draw a flowchart that displays 3 inputted numbers in ascending order.
Use repetition control structure. Click the flowchart to enlarge.


Labels: , , , ,

Monday, September 07, 2009

Flowcharting Group 5 - del Pilar

Draw a flowchart that displays 3 inputted numbers in ascending order. Use repetition control structure.





Labels: , , , ,

group 3 del pilar flowchart

Draw a flowchart that displays 3 inputted numbers in ascending order. Use repetition control structure.




Labels: , , , ,

flowchart group 7-del pilar

GROUP 7- DEL PILAR

Draw a flowchart that displays 3 inputted numbers in ascending order. Use repetition control structure.




Labels: , , , ,

Friday, September 04, 2009

Question of the Week

What is structured settlement?

Answer:

A structured settlement is a financial or insurance arrangement, including periodic payments, that a claimant accepts to resolve a personal injury tort claim or to compromise a statutory periodic payment obligation.

Example:

If you have problem paying your tax or income tax here in the Philippines, why not follow or ask a structured settlement mode of paying your income tax.


Labels:

Thursday, September 03, 2009

Evaluating C Expressions

Given: x=3; y=2; j=5;k=3, evaluate the expression, ( x - y ) < = ( j - k == 3 ) and determine whether it yield a value of True or False.

Solution:

(x - y) <= ( j - k == 3 )

(3 - 2) <= (5 - 3 ==3)

(1) < = ( 2 == 3)

true < = false

1 < = 0

FALSE

Labels:

Wednesday, September 02, 2009

Evaluating C Expressions

Evaluate the ff. expressions and determine whether they yield a value of True or False.

1. Given: dei=0; y=4.0; z=2.0; x=3.0, evaluate the expression: !dei||(y+z>=x-z)?

Solution:

!dei || ( y + z >= x - z )

!0 || ( 4.0 + 2.0 >= 3.0 - 2.0)

!false || (6.0 >= 1.0)

true || true


TRUE

Labels:

Assignment for Class Del PIlar

Draw a flowchart that displays 3 inputted numbers in ascending order. Use repetition control structure.

Deadline:
September 7, 2009.

Good Luck!

Labels:

Tuesday, September 01, 2009

About Google Ads

At the top portion of the screen and below the Message Box are the so called google ads. What are they? They are advertisements from the Google Corporation when click, they will pay you. For more questions about online marketing or earning money at the web, ask your TLE teacher (about this. Your welcome to join this endeavor.

What are you waiting for, click now the google ads of this blog. Hehehe.

Labels:

Lesson of the Day - Bitwise Operator (C Programming)


If use in the program, it goes like this:

#include
main()
{
int x,y;
printf("Enter the value of x:");
scanf("%d",&x);
y=x>9 ? 100:200;
printf("The value of y is %d.",y);
getch();
}

The output in the screen after being run is:

Enter the value of x: 10
The value of y is 200.

Explanation:

Because when the expression is false the value of y is the 200. And if the expression is true, the value of y is 100. Therefore, n:d (100:200) n is display when true and d is display when false.



Labels: