December 14, 2008
sort.h
#include<iostream>
#include<conio.h>
using namespace std;
class Node
{
public:
Node()
{
head = NULL;
}
void setData(int val)
{
if(head==NULL)
{
head = new Node;
head->data = val;
head->link = NULL;
cout<<val;
}
else
{
Node *temp, *prev;
temp = head;
while(temp->link !=NULL)
{
temp = temp->link;
}
prev = new Node;
prev->data = val;
prev->link = NULL;
temp->link = prev;
}
}
void insertItem(int val)
{
if(head==NULL)
{//empty
head=new Node;
head->data=val;
head->link=NULL;
}
else
{//head=100
Node *temp;
Node *prev;
temp=head;//100->1->NULL
while(temp->link!=NULL)
{
temp=temp->link;//100->1->23->NULL
}
prev=new Node;
prev->data=val;
prev->link=NULL;
temp->link=prev;//100->1->23->24->NULL
}
}
bool removeNode(int val)
{
if(head != NULL)
{
Node *temp, *rem, *prev;
if(head->data == val)
{
prev = head;
if(head->link != NULL)
head = head->link;
else
head = NULL;
delete prev;
return true;
}
temp = head->link;
prev = head;
while(temp != NULL)
{
if(temp->data == val)
{
prev->link = temp->link;
delete temp;
return true;
}
prev = temp;
temp = temp->link;
}
}
return false;
}
void displayItems()
{
if(head != NULL)
{
Node *temp, *prev;
temp = head;
cout<<"\n"<<temp->data<<"->";
while(temp->link != NULL)
{
temp = temp->link;
cout<<temp->data<<"->";
}
cout<<"NULL\n";
}
else
cout<<"\nList is empty.";
}
int nodeCount()
{
if(head !=NULL)
{
Node *temp;
temp = head;
int cnt = 1;
while(temp->link != NULL)
{
temp = temp->link;
cnt++;
}
return cnt;
}
else
return 0;
}
void sort()
{
Node *current;
current = head;
while(current != NULL)
{
Node *next;
next = current->link;
while(next != NULL)
{
if(current->data > next->data)
{
Node *temp;
temp = new Node;
temp->data = current->data;
current->data = next->data ;
next-> data = temp->data ;
delete temp;
}//end if
next = next->link;
}
current = current->link;
}
} //end while
private:
int data;
Node *link;
Node *head;
};
===========================================
sort.cpp
#include "Sort.h"
using namespace std;
int main()
{
Node n;
int choice = 0;
int val = 0;
while(choice != 5)
{
cout<<"\n1.Enter newItem";
cout<<"\n2.Remove Item";
cout<<"\n3.Display list";
cout<<"\n4.Get Item count";
cout<<"\n8.Sort";
cout<<"\n6.Exit";
cout<<"\n5.append item: ";
cout<<"\nChoice: ";
cin>>choice;
switch(choice)
{
case 1:
cout<<"\nEnter value of newItem: ";
cin>>val;
n..setData(val);
n.displayItems();
break;
case 2:
cout<<"\nEnter value of Item: ";
cin>>val;
n.removeNode(val);
n.displayItems();
break;
case 3:
n.displayItems();
break;
case 4:
cout<<"\nNode count: "<<n.nodeCount();
break;
case 5:
cout<<"\nEnter item to be inserted: ";
cin>>val;
n.insertItem(val);
n.displayItems();
break;
case 8:
n.sort();
n.displayItems();
break;
default:
cout<<"\nWrong choice";
}//end switch
}//end while
getch();
return 0;
}//end main
August 18, 2008
this is another problem in our computer programming language 2 wherein our posted through the web…i am having a boring night so i decided to give it a try and make the codes..and maybe this is an exercise to study for the upcoming paascu visit in our school for our department’s level accreditation…hope we will make it…anyways here is the code that code…i hope this is right…it maybe not clean but still was able to put it through…ehehhe
#include<iostream>
#include<string.h>
#include<ctype.h>
#include<stdlib.h>
#include<conio.h>
#include<stdio.h>
using namespace std;
main()
{
char name[20];
char last[20];
char mid[20];
char add[20];
char name2[20];
char last2[20];
char mid2[20];
char add2[20];
char name3[20];
char last3[20];
char mid3[20];
char add3[20];
char full[20];
char full2[20];
char age[20];
int sum=0;
cout<<"Enter first name: ";
gets(name);
cout<<"Enter last name: ";
gets(last);
cout<<"Enter middle initial: ";
gets(mid);
cout<<"Enter address: ";
gets(add);
cout<<"Enter age: ";
cin>>age;
strcpy(name2,name);
strcpy(last2,last);
strcpy(mid2,mid);
strcpy(add2,add);
strcpy(name3,name);
strcpy(last3,last);
strcpy(mid3,mid);
strcpy(add3,add);
sum=(strlen(name)+strlen(last)+strlen(mid)+strlen(add)+strlen(age));
cout<<"\n";
strcat(full,name);
strcat(full," ");
strcat(full,mid);
strcat(full,". ");
strcat(full,last);
strcat(full,", ");
strcat(full,add);
strcat(full,", ");
strcat(full,age);
cout<<full;
cout<<"\n";
strcat(full2,age);
strcat(full2," ");
strcat(full2,add);
strcat(full2,", ");
strcat(full2,last);
strcat(full2,", ");
strcat(full2,name);
strcat(full2," ");
strcat(full2,mid);
strcat(full2,".");
cout<<full2;
cout<<"\n\nFirstName\tLastName\tMI\tAddress\t\tAge\tLength";
cout<<"\n————————————————————–";
cout<<"\n"<<name<<"\t"<<last<<"\t\t"<<mid<<"\t"<<add<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<strupr(name)<<"\t"<<strupr(last)<<"\t\t"<<strupr(mid)<<"\t"<<strupr(add)<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<strlwr(name)<<"\t"<<strlwr(last)<<"\t\t"<<strlwr(mid)<<"\t"<<strlwr(add)<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<strrev(name)<<"\t"<<strupr(last)<<"\t\t"<<strrev(mid)<<"\t"<<strupr(strrev(add))<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<strupr(strrev(name2))<<"\t"<<strlwr(last)<<"\t\t"<<strupr(mid)<<"\t"<<strlwr(add2)<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<strlwr(strrev(name2))<<"\t"<<strlwr(last)<<"\t\t"<<strlwr(mid)<<"\t"<<strlwr(strrev(add))<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<strlwr(name2)<<"\t"<<strupr(strrev(last))<<"\t\t"<<strlwr(mid)<<"\t"<<strupr((add))<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<strupr(strrev(name2))<<"\t"<<strupr(strrev(last))<<"\t\t"<<strupr(mid)<<"\t"<<strupr(strrev(add))<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<strlwr((name2))<<"\t"<<strlwr((last))<<"\t\t"<<(mid)<<"\t"<<strlwr((add))<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<((name2))<<"\t"<<((last2))<<"\t\t"<<(mid2)<<"\t"<<strupr(strrev(add2))<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<(strrev(name2))<<"\t"<<strupr(strrev(last2))<<"\t\t"<<(mid2)<<"\t"<<strupr(strrev(add2))<<"\t"<<age<<"\t"<<sum;
cout<<"\n\n"<<(strlen(name2))<<"\t\t"<<(strlen(last2))<<"\t\t"<<strlen(mid2)<<"\t"<<(strlen(add2))<<"\t\t"<<strlen(age)<<"\t"<<sum;
cout<<"\n\nFirstName\tLastName\tMI\tAddress\t\tAge\tLength";
cout<<"\n"<<((name2))<<"\t"<<strlwr(strrev(last2))<<"\t\t"<<(mid2)<<"\t"<<strlwr((add2))<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<(strupr(name2))<<"\t"<<strupr((last2))<<"\t\t"<<strupr(mid2)<<"\t"<<strupr((add2))<<"\t"<<age<<"\t"<<sum;
cout<<"\n"<<(strrev(name2))<<"\t"<<strrev((last2))<<"\t\t"<<strlwr(mid2)<<"\t"<<strrev((add2))<<"\t"<<age<<"\t";
cout<<"\n"<<(strlwr(name2))<<"\t"<<strlwr((last2))<<"\t\t"<<(mid2)<<"\t"<<strlwr((add2))<<"\t"<<age<<"\t";
cout<<"\n\n"<<(strlen(name2))<<"\t\t"<<(strlen(last2))<<"\t\t"<<strlen(mid2)<<"\t"<<(strlen(add2))<<"\t\t"<<strlen(age)<<"\t"<<sum;
cout<<"\n\n"<<(strupr(name3))<<" "<<(strupr(mid3))<<". "<<(strupr(last3))<<", "<<(strupr(add3))<<", "<<age;
cout<<"\n"<<((age))<<" "<<((add3))<<", "<<((last3))<<", "<<((name3))<<" "<<mid3<<".";
cout<<"\n\nThe first name "<<name3<<" is not the same with last name "<<strrev(last3);
cout<<"\nThe reverse first name "<<strrev(name3)<<" is not the same with reverse last name "<<(last3);
cout<<"\n-end-";
getch();
}
August 14, 2008
Staring at women’s breasts is good for men’s health and makes them live longer, a new survey reveals. Researchers have discovered that a 10-minute ogle at women’s breasts is as healthy as half-an-hour in the gym. A five-year study of 200 men found that those who enjoyed a longing look at busty beauties had lower blood pressure, less heart disease and slower pulse rates compared to those who did not get their daily eyeful. Dr. Karen Weatherby who carried out the German study, wrote in the New Englad Journal of Medicine: "Just 10 minutes of staring at the charms of a well endowed female is roughly equivalent to a 30-minute aerobics workout. "Sexual excitement gets the heart punping and improves blood circulation. "There is no question that gazing at breasts makes men healthier". "Our Study indicates that engaging in this activity a few minutes daily cuts the risk of a stroke and heart attack in half". "We believe that by doing so consistenly, the average man can extend his life four to five years".
August 12, 2008
Here are other PTC’s which you can earn from…just click each of them register and then click the links and then earn from just doing that…no hussle…click me and click me too. Now start earning…click them now!!
August 10, 2008
gud eve..isn’t it boring just surfing the net..reading emails..editing your friendster,myspace profiles…?well i was browsing this one forum where i usually hang out to. and i’ve read this one thread where in you could actually earn by just clicking ads…I dont know how this one is but the topic starter showed some proof of earnings. i really dont know if it was true, i got a little curious about and so i decided to try it myself thinking that what if it is true..?what if you could really earn money by just clicking this ads..well it’s not too much for me and for everyone i guess..you just click and w8 for thirty(30) seconds and then you earn $00.01 per click…i just started it this night so i really don’t know what’s the outcome of this so if you fguys want to try it then it’s for to decide…what will you have to lose anyway..you’ll just click the banners below
rank #1 in PTCtalk
rank #2 in PTCtalk
rank #3 in PTCtalk

rank #4 in PTCtalk
August 7, 2008
this was our quiz on our computer programming 2 subject which was given earlier today, august 7, 2008. It’s about character strings…its kinda hard for me since i wasn’t around last tuesday when this topic was discussed by our professor. so i kinda had a rough start. i wasn’t able to finish this quiz and got a grade of 72%. it was whack. i mean i could have finished it on time but to no avail i failed. so here’s the codes which i think is right but it maybe not the cleanest but i think it is fine…:)
#include<iostream>
#include<conio.h>
#include<string.h>
#include<ctype.h>
using namespace std;
main()
{
char name[20];
char name2[20];
char num[20];
char num2[20];
int sum=0;
cout<<"Enter name: ";
gets(name);
cout<<"Enter 1st number:";
cin>>num;
cout<<"Enter 2nd number:";
cin>>num2;
sum=atoi(num2)+atoi(num);
strcpy(name2, name);
cout<<"\nThe sum is "<<sum;
cout<<"\nThe reverse value of the name is "<<(strrev(name));
cout<<"\nThe length of the name is "<<(strlen(name));
cout<<"\nThe uppercase value of the name is "<<(strrev(strupr(name)));
cout<<"\nThe lowercase value of the name is "<<(strlwr(name));
cout<<"\nThe reverse uppercase value of the name is "<<(strrev(strupr(name)));
cout<<"\nThe reverse lowercase value of the name is "<<strlwr(name);
cout<<"\nThe combination values are "<<name2<<name;
getch();
}
that’s all i can come up as of the moment kinda dirty and not a good code but still usable..
so til next time i gotta go to school cause i have a class at 6:30 later tonight but i have a referral slip to fix to…so ciao
July 28, 2008
#include<iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;
main()
{
int num[50],num2[50];
float ave,sum=0,sum2=0,ave2;
int a,b,c,d,e,f,shift;
char choice;
cout<<"Enter number of array: ";
cin>>c;
if(c>=51)
{
cout<<"Array out of range";
}
else if(c<=50){
cout<<"Enter "<<c<<" Number: ";
for (a=1; a<=c; a++)
{
cin>>num[a];
sum=sum+num[a];
ave=sum/c;
}
for(a=1;a<=c;a++)
{
for(b=1;b<=c;b++)
{
if(num[a] > num[b])
{
shift=num[a];
num[a]=num[b];
num[b]=shift;
}
}
}
cout<<"\nThe numbers entered in reverse are: ";
for (a=1; a<=c; a++)
{
cout<<" "<<num[a];
}
cout<<"\nThe numbers entered after x2: ";
for (d=c; d>=1; d–)
{
num2[d]=num[d]*2;
cout<<" "<<num2[d];
sum2=sum2+num2[d];
ave2=sum2/c;
}
for(d=1;d<=c;d++) {
for(f=1;f<=c;f++){
if(num2[d] > num2[f]) {
shift=num2[d];
num2[d]=num2[f];
num2[f]=shift;
}
}
}
for(d=1;d<=1;d++)
{
cout<<"\n\nHighest # from\t\tAverage # from\t\tlowest # from\n";
cout<<"Original Input\t\tOriginal Input\t\tOriginal Input\n";
}
for(d=1; d<=21; d++)
{
cout<<"—";
}
for(d=1; d<=1; d++)
{
cout<<"\n"<<num[1]<<"\t\t\t "<<ave<<"\t\t\t "<<num[c];
}
for(d=1; d<=1; d++)
{
cout<<"\n\nHighest # from\t\tAverage # from\t\tlowest # from\n";
cout<<"x2 Input\t\tx2 Input\t\tx2 Input\n";
}
for(d=1; d<=21; d++)
{
cout<<"—";
}
for(d=1; d<=1; d++)
{
cout<<"\n"<<num2[1]<<"\t\t\t "<<ave2<<"\t\t\t "<<num2[c];
}
}
cout<<"\n\nPlease repeat the process?[y for yes, n for no]: ";
cin>>choice;
system("cls");
if (choice==’y')
{
return (main());
}
else if (choice==’n')
{
exit (0);
}
getch();
}
May 1, 2008
Online community designed specifically for Filipinos. Very friendly community with lots of professionals to answer your cellphone and computer queries. You may also find free applications, games, themes, and other multimedia files for you phone or PC.
Discussions are not pure technical. Anything can be discuss, from deep, contemporary conversations to meaningless, shallow chit-chat. Visit: <a href="http://www.symbianize.com" title="Exclusive Pinoy Chat, Mobile, and PC Community">http://www.symbianize.com</a>
<a href="http://www.symbianize.com" title="Exclusive Pinoy Chat, Mobile, and PC Community"><img src="http://www.symbianize.com/images/symbianize.gif" border="0" /></a>
October 11, 2007
The Impact of Blogging to Me is that it has taught me how to be organized….it has taught me how to express myself out in the open….i has made me…..use my mind instead of just letting it rust…..Blogging has a big impact to me….aside from it can make or break me….because it is part of my CAPP subject….it has taught me to use my time wisely…it has taught me to be more updated….to learn what is happening around me….what is going on around me……what is the news….what is new around me….it has taught me to use my mind….it has taugh me to be more active and read more often…..I has taught me alot of things…the Impact of blogging to me is that it made me more of me than I was before….blogging has been me……..
BSIT is fun yet a taugh course……..BSIT IT is the course i have chosen….i have chosen because i want it…..not because somebody told me to want it….BSIT is my chosen field…therefore i must perservere and must be dedicated….well, i am dedicated enough to finish this course…BSIT course is for everyone only if they are up to the challenge….challenge between them and theirselves…a duel of your own…a battle inside of a person…..BSIT is for everyone only if they are able to conquer thierselves and only if they are prepared and well crafted…….I am well prepared…..I have conditioned myself that whatever happens i will finish this course….this what i chose, so i must live with that decision and make sure to have a better, if not best, results….so BSIT is the course for me…