Tuesday, February 24, 2009

EXER7 CS121

OUTPUT OF EXERCISE 7
Photobucket

CODES USED:

#include
#include
#include
void menu();
void nextscreen();
void nextscreen2();

void nextscreen()
{
clrscr();
int x,y,z;
for(x=1;x<=77;x++)
{
gotoxy(2+x,1);textcolor(GREEN);cprintf("Í");
//delay (10);
gotoxy(2+x,21);textcolor(GREEN);cprintf("Í");
//delay (10);
}
for(y=1;y<=20;y++)
{
gotoxy(3,1+y);textcolor(GREEN);cprintf("º");
//delay (10);
gotoxy(79,1+y);textcolor(GREEN);cprintf("º");
//delay (10);
}
gotoxy(3,1);textcolor(GREEN);cprintf("É");
gotoxy(3,21);textcolor(GREEN);cprintf("È");
gotoxy(79,1);textcolor(GREEN);cprintf("»");
gotoxy(79,21);textcolor(GREEN);cprintf("¼");
}
void menu()
{
nextscreen();
nextscreen2();
int choice,a,b,n,y,sum=0,sub=0,mul=0,div=0,z;
gotoxy(30,2);textcolor(LIGHTRED);cprintf("Exercise VII");
gotoxy(30,5);textcolor(LIGHTGREEN);cprintf("WeLcomE!!");
gotoxy(26,6);textcolor(LIGHTRED);cprintf("\nSelect operation you like to Try!");
gotoxy(25,8);textcolor(YELLOW);cprintf("\n\t[A] for ADDITION");
gotoxy(25,9);textcolor(BLUE);cprintf("\n\t[B] for SUBTRACTION");
gotoxy(25,10);textcolor(CYAN);cprintf("\n\t[C] for MULTIPLICATION");
gotoxy(25,11);textcolor(RED);cprintf("\n\t[D] for DIVISION");
gotoxy(25,12);textcolor(GREEN);cprintf("\n\t[E] for Exit");
gotoxy(25,14);textcolor(YELLOW);cprintf("\nEnter your choice operation here:");
scanf("%s",&choice);

switch(choice)
{
case 'A':

clrscr();

nextscreen();
nextscreen2();
gotoxy(25,5);textcolor(CYAN);cprintf("A] Addition");
gotoxy(25,6);textcolor(CYAN);cprintf("Enter number:");
scanf("%d",&a);
gotoxy(25,8);textcolor(CYAN);cprintf("Enter 2nd number:");
scanf("%d",&b);
sum=a+b;
gotoxy(25,10);textcolor(CYAN);cprintf("Sum of two number is: %d",sum);
gotoxy(25,12);textcolor(CYAN);cprintf("NicE onE!!\n");
gotoxy(25,14);textcolor(CYAN);cprintf("Do you want to try again,y/n?");
scanf("%s",&z);
menu();
getch();

break;
}

switch(choice)
{
case 'B': clrscr();
nextscreen();
nextscreen2();
gotoxy(25,5);textcolor(YELLOW);cprintf("B] Subtraction");
gotoxy(25,6);textcolor(YELLOW);cprintf("Enter number:");
scanf("%d",&a);
gotoxy(25,8);textcolor(YELLOW);cprintf("Enter 2nd number:");
scanf("%d",&b);
sub=a-b;
gotoxy(25,10);textcolor(YELLOW);cprintf("Subtraction of two number is: %d",sub);
gotoxy(25,12);textcolor(YELLOW);cprintf("NicE onE!!");
gotoxy(25,14);textcolor(YELLOW);cprintf("Do you want to try again,y/n?");
scanf("%s",&z);
menu();
getch();

break;
}

switch(choice)
{
case 'C':
clrscr();
nextscreen();
nextscreen2();
gotoxy(25,5);textcolor(BLUE);cprintf("C] Multiplication");
gotoxy(25,6);textcolor(BLUE);cprintf("Enter number:");
scanf("%d",&a);
gotoxy(25,8);textcolor(BLUE);cprintf("Enter 2nd number:");
scanf("%d",&b);
mul=a*b;
gotoxy(25,10);textcolor(BLUE);cprintf("Muliplication of two number is: %d",mul);
gotoxy(25,12);textcolor(BLUE);cprintf("NicE onE!!");
gotoxy(25,14);textcolor(BLUE);cprintf("Do you want to try again,y/n?");
scanf("%s",&z);
menu();
getch();

break;
}

switch(choice)
{
case 'D':
clrscr();
nextscreen();
nextscreen2();
gotoxy(25,5);textcolor(RED);cprintf("D] Division");
gotoxy(25,6);textcolor(RED);cprintf("Enter number:");
scanf("%d",&a);
gotoxy(25,8);textcolor(RED);cprintf("Enter 2nd number:");
scanf("%d",&b);
div=a/b;
gotoxy(25,10);textcolor(RED);cprintf("Division of two number is: %d",div);
gotoxy(25,12);textcolor(RED);cprintf("NicE onE!!");
gotoxy(25,14);textcolor(RED);cprintf("Do you want to try again,y/n?");
scanf("%s",&z);
menu();
getch();

break;
}



switch(choice)
{
case'E':

gotoxy(15,18);textcolor(LIGHTRED);cprintf("\n\nEnd of the program,Tinkchoi for browsing!! (-_-)");

}


}
void nextscreen2()

{
clrscr();
int a,b,x,y,z;

for(x=1;x<=77;x++)
{
gotoxy(2+x,1);textcolor(GREEN);cprintf("Í");
gotoxy(2+x,21);textcolor(GREEN);cprintf("Í");
}
for(y=1;y<=20;y++){
gotoxy(3,1+y);textcolor(GREEN);cprintf("º");
gotoxy(79,1+y);textcolor(GREEN);cprintf("º");
}
gotoxy(3,1);textcolor(GREEN);cprintf("É");
gotoxy(3,21);textcolor(GREEN);cprintf("È");
gotoxy(79,1);textcolor(GREEN);cprintf("»");
gotoxy(79,21);textcolor(GREEN);cprintf("¼");
for(a=1;a<=49;a++)
{
gotoxy(15+a,4);textcolor(MAGENTA);cprintf("¯");
gotoxy(15+a,17);textcolor(MAGENTA);cprintf("¯");
}
for(b=1;b<=14;b++)
{
gotoxy(16,3+b);textcolor(MAGENTA);cprintf("¯");
gotoxy(65,3+b);textcolor(MAGENTA);cprintf("® ");
}
}
void main()
{
clrscr();

nextscreen();
nextscreen2();
menu();
getch();

}

Saturday, February 14, 2009

EXER6 CS121

Photobucket
#include
#include


void main()
{ clrscr();
float grade,average,sum;
int a=0;

while(grade!=-1)
{ sum=sum+grade;
printf("\n\n_-_-_-_-_-_-_-_-_-_-_");
printf("\nEnter grade; -1 to exit");
scanf("%f",&grade);

if(grade==-1)
{printf("\n\n\n\t\t\t.,.,.,.,.,.,.,.,.,.,.,.");
printf("\n\t\t\tAverage is %.2f\n",average=sum/a);}
a++;
}
if(average>=95 && average<=100){ printf("\n\nRated of this average: A");} else if(average>=90 && average<=94){ printf("\n\nRated of this average: B");} else if(average>=89 && average<=90){
printf("\n\nRated of this average: C");}
getch();
}

Wednesday, February 11, 2009

EXER5 CS 121

Photobucket
#include
#include
#include

void main(){
clrscr();
int h,i,j,x,y,choice,X;

printf("\nEnter your favorite number:");
scanf("%d",&h);
printf("\nSelect pattern you like to appear!");
printf("\n\t[A] for Pattern 1");
printf("\n\t[B] for Pattern 2");
printf("\n\t[C] for Pattern 3");
printf("\n\t[D] for Pattern 4");
printf("\nEnter your choice Pattern here:");
scanf("%s",&choice);
switch(choice)
{
case 'A':
for(i=1,y=10;i<=h;i++,y++) { for(j=1,x=35;j<=i;j++,x++) { gotoxy(x,y); printf("*"); } } break; case 'B': for(i=1,y=10;i<=h;i++,y++) { for(j=1,x=35;j<=i;j++,x--) { gotoxy(x,y); printf("*"); } } break; case 'C': for(i=h,y=10;i<=h;i--,y++) { for(j=i,x=35;j>=1;j--,x++)
{
gotoxy(x,y);
printf("*");
}
}
break;

case 'D':
for(i=h,y=10;i>=1;i--,y++)
{
for(j=i,x=35;j>=1;j--,x--)
{
gotoxy(x,y);
printf("*");
}
}
break;
}
printf("\n\nYou got a nice pattern! ;)) \n\n made by:n\n ¯Jayson Madijanon ");
getch();
}

Exer4 CS121

Photobucket

#include
#include

int salary, years, x=0,bonus=0;
void main(){
clrscr();
printf("\nEnter Salary:");
scanf("%d", &salary);
printf("\nEnter Years of Service:");
scanf("%d", &years);
if (years==1){
bonus=salary*0.10;
x=salary+bonus;
printf("\nBonus: %d", bonus);
printf("\nTotal Salary: %d",x);
}
else if ((years<=5) && (years>=2)){
bonus=salary*0.20;
x=salary+bonus;
printf("\nBonus: %d", bonus);
printf("\nTotal Salary: %d",x);
}
else if ((years<=10) && (years>=6)){
bonus=salary*0.50 ;
x=salary+bonus;
printf("\nBonus: %d", bonus);
printf("\nTotal Salary: %d",x);
}
else if (years<=11){
bonus=salary*0.75;
x=salary+bonus;
printf("\nBonus: %d", bonus);
printf("\nTotal Salary: %d",x);
}
printf("\n\n\n\n\t\t\t\t\t\tCreated by: jayson cadena madijanon");
getch();
}

Exer3 CS121

Photobucket

#include
#include


void main(){
clrscr();
int choice,a,b,n,y,sum=0,sub=0,mul=0,div=0;

printf("W E L C O M E ! ! !");
printf("\nSelect operation you like to Try!");
printf("\n\t[A] for ADDITION");
printf("\n\t[B] for SUBTRACTION");
printf("\n\t[C] for MULTIPLICATION");
printf("\n\t[D] for DIVISION");
printf("\n\t[E] for Exit");
printf("\nEnter your choice operation here:");
scanf("%s",&choice);
switch(choice)
{
case 'A':
printf("Enter number:");
scanf("%d",&a);
printf("Enter another number:");
scanf("%d",&b);
sum=a+b;
printf("Sum of two number is: %d",sum);
break;

case 'B':
printf("Enter number:");
scanf("%d",&a);
printf("Enter another number:");
scanf("%d",&b);
sub=a-b;
printf("Sub of two number is: %d",sub);
break;

case 'C':
printf("Enter number:");
scanf("%d",&a);
printf("Enter another number:");
scanf("%d",&b);
mul=a*b;
printf("Mul of two number is: %d",mul);
break;

case 'D':
printf("Enter number:");
scanf("%d",&a);
printf("Enter another number:");
scanf("%d",&b);
div=a/b;
printf("Div of two number is: %d",div);
break;

case'E':
printf("\n\nEnd of the program,\nThank you very much!!!! ");


}
printf("\n\n\t\t\t\t\t\tCreated by: Jayson Madijanon");
getch();
}

Exer2 CS121

Photobucket

#include
#include

main()
{
clrscr();
printf("\n\n\t\t\t\tMy Autobiography ! ! \n\n\n");
printf("I am Jayson C.Madijanon\n17 years young,\nBorn on July 20,1991,a jolly person who always talk with sense and optimistic and idealistic\n");
printf("Im living at Puan , Davao City together with my family\nI graduated secondary level of education at Talomo National High School");
printf("\n\n\n\t\Thanks a Lot for viewing this!!");
printf("\n\n\n\n\t\t\t\t\t\tCreated by: Jayson Cadena Madijanon");
getch();
}

Exer1 CS 121

Photobucket

#include
#include
void main(){
printf("Hello world");
getch();
}



Tuesday, February 10, 2009

Overwhelmed because of the EXAMS

anyway im so happy because obviously i've passed the 1st and 2nd exam. I will never heard the scream of my dad hehe!!!



^^, happy to the bobe..

i will keep it

ME as Me and No Other

This profile made through my ramdom thoughts and ideas, hope you will enjoy and have some fun in exploring my blogs.Hello guys, my name is JAYSON CADENA MADIJANON, 16 years of young currently living in Davao City. A 5'4 tall person and weighs 45 lbs., I am molding my future here in University of Mindanao where i am taking up Bachelors degree in Information Technology wherein i cant say either way that if ever i have a future in this, i always go with the flow and nevertheless im trying to do my whole best to master this.Life in college, in first i can't adjust because everything goes change and yet , there are many people who are new in me, including my Professor he is Allen Reynon who keep on telling us to pursue this course and study for trials may challenge us and it is not yet the starts of calvary nor may challenges would come after finishing this level. A calvary for all I.T students "the programming", a little and easy to say words but it has deep and complicated counterpart in the side of the students, sometimes i could say it makes my nose bleeding..indeed. But despite of that i dont stop to overcome my fear in this subject , i choose this so i must finish this and build my future here.I'm living with my father and sisters because obviously my mom is not here, he went abroad for us, she do everything for us , i can't deny the fact that i came from a broken family but instead to get swallowed i am standing and still remains strong cause i do believe somehow all be alright in the time to come.As i conveying my journey in life it seems that i must pass many obstacles and hindrance for me to succeed. I keep on dreaming that i may havge my peak wherein only happiness and joys may seen.