August 30, 2009

Links for C compilers (specifically Turbo C and Quincy 2005)

For Quincy 2005
http://www.codecutter.net/tools/quincy/

For Turbo C
http://edn.embarcadero.com/article/20841

They are both c compilers. but the difference between the two compilers is that Turbo C is a little bit more strict in terms of coding than Quincy 2005. as what my teacher have said to us. There is one case wherein in Quincy 2005, you can run the program without the Return value and doesn't display an error message if logical error is committed like this for example 90< x >180. As what my teacher have said it is a logical error if you type it like that in the example. you usually don't get the exact result. To be also honest with you guys, I often don't used Turbo C in my programming because it is not user friendly. But I have tried it many times as often.

Functions

====================================================
#include <>
#include <>

int main ()
{
//Local Declarations
int a;
int b;
//Statements
printf("Square root of");
scanf("%d",&a);
b=sqrt(a);
printf("%d is the square root of %d",b,a);
return 0;
}

=================================================================
#include <>
#include <>

//Function Declarations
int square (int x);


int main ()
{
//Local Declarations
int a;
int b;
//Statements
printf("Square root of");
scanf("%d",&a);
b=square(a);
printf("%d is the square root of %d",b,a);
return 0;
}
int square (int x)
{
//Statements
return (sqrt(x));
}
====================================================================

August 24, 2009

How to manually remove a virus from a removable drive without using an antivirus program

Courtesy of youtube.
you can watch this also at http://www.youtube.com/watch?v=pVlLOPcO7cM


NOTE: Don't try to open the infected removable drive.
For it will no longer be useful to use this technique if the virus had infected your computer.(^_^)

Project 62 (Menu-driven program)

62. Write a menu-driven program that allows a user to enter five numbers and then choose between finding the smallest, largest, sum or average. The menu and all the choices are to be functions. Use a switch statement to determine what action to take. Provide an error message if an invalid choice is entered.

OUTPUT PROGRAM

Start of the Program


Option 1

Option 2



Option 3


Option 4

Default message

August 23, 2009

The Parking Lot Problem (Sample Output)

Sorry I removed the codes. I will post the code after i made some improvements on the code.
For you to have a simple style of code
But Here's the sample output:

Option 'c' or the "Car" vehicle type




Option 't' or the "Truck vehicle type.



Option 'b' or the "Truck" vehicle type.

The Parking Lot problem. (c source code)





August 20, 2009

Guessing game (c program code)

#include
int main ()
{
int n;
const int guess=10;
int flag=0;
printf("Guess the number that i am thinking\n");
scanf("%d",&n);
if (!(n>=guess))
printf("Your number is too low. try again\n");
else if (n>guess)
printf("Your number is too high. Try again\n");
else
flag=1;
if (flag==0)
scanf("%d",&n);
if (!(n>=guess))
printf("Your number is too low. try again\n");
else if (n>guess)
printf("Your number is too high. Try again\n");
else
flag=1;

if (flag==0)
scanf("%d",&n);
if (!(n>=guess))
printf("Your number is too low. try again\n");
else if (n>guess)
printf("Your number is too high. Try again\n");
else
flag=1;

if (flag==0)
scanf("%d",&n);
if (!(n>=guess))
printf("Your number is too low. try again\n");
else if (n>guess)
printf("Your number is too high. Try again\n");
else
flag=1;

if (flag==0)
scanf("%d",&n);
if (!(n>=guess))
printf("Your number is too low. try again\n");
else if (n>guess)
printf("Your number is too high. Try again\n");
else
flag=1;



if (flag==1)
printf("Congrats\n");
else
printf("im sorry!");
return 0;
}

This a simple guessing game program that was written using Quincy. Instead of using random function I intialized the guess to 10 wherein the number to be guessed is 10. and rather using a loop I used the if and else statements. The user is given 5 tries to guess the number. After 5 tries the program will display the "im sorry!". NOTE: I have change the expression statements in the if...

RESULTS


Start of the program...






*The program displays "Congrats" after successfully guessing the number.



*The program still continues to give the user a chance to guess the number.



*The program terminates after five tries had been given to the user.. and displays the "im sorry" message..




March 28, 2009

Artless artworks! :-)


As you can see! hehehe.. This is a summer inspired art for our section! hehehe. I used Adobe Illustrator in this project. Any suggestions and wild reactions? Lol! 








Isn't cool? it's very obvious that I'm a die hard fan of my section in highschool! I don't understand why I kept on making logos for my section! nobody seems to like it neither of my classmates! Hope you like this masterpiece of mine. It was inspired by my brother's project or to say I just copied his design! 
Peace!






Ahhh.. This is one of my art that I'm proud to share to you! :-) Unlike any other art that I made wherein the subject is always my section, this was personally inspired by myself. As you can see this was a music inspired art because I'm a music lover just like any other people. Specifically, my favorite genre of music are the ones that are being remixed by my favorite djs. :-)



HOPE you like my art pieces! feel free to comment and express your reactions regarding my artworks.. :-)

March 26, 2009

Mmrs of my Highschool life!

At last i feel free right now!

Time to say goodbye to strict teachers, teachers that has dump us a lot of projects,  inadequate sleep,  and noisy classmates! (even though i was one of them!) LOL!. 
It was indeed a tiring and enjoyable chapter in my life. I've met new friends, enemies and persons that are worthy of my envy.. hehehe... It was indeed the chapter full of realizations. One of those was that i'm longer a child (hehehe). Trying to act and think like an adult. Forgetting those childish acts and habits like running around with dirty uniforms, full of sweat, and smelling bad. Being conscious about B.O. has become my concern because girls don't like it! (hehehehe).

At first I was really excited to graduate from highschool but after the day of our graduation I realized that how would life look like after that memorable moment. Soon questions arise from deep inside of me. Questions like "Where will I go after this?"," Who will be my new friends?"," What would my college life have to offer?" and "Will I be able to finish college?". Uncertainty soon engulfed my mind that had resulted into confusions and frustrations. I feel frustrated for not being able to bag a single medal in highschool and for not passing the college entrance exam of my dream school -UP. I only needed 0.1 to pass that examination. But I guess it wasn't really meant for me or maybe its a wake up call for me to be serious in my future undertakings especially when I'm about to take up my college degree.