The scientists of Japan created a computer that can read the sleeping minds. The chose three volunteer for this. The volunteers has slept in MRI machine. After 6 minute they woke up and asked about the dream that what they had seen. They continued this process for 200 dreams for each volunteer. While this Dream Catcher kept catching the rays of their brains. At last they decoded the brain scans, it has proven that the dream catcher can read our dreams. According to the scientists the results are 60 percent accurate.
Friday, 5 April 2013
How to Delete Labels: Blogger
When I tried to remove some labels from my blog then I found that it is a bit difficult.
The blogger interface don't gives any direct option for this. Although we can remove it one by one by editing each post and removing the label from the post.
When the label which you want to remove is removed from every post, that label is removed from your blog.
Editing All the posts one by one really a tough and boring task to do.
But we can remove the labels from more than one posts.
The blogger interface don't gives any direct option for this. Although we can remove it one by one by editing each post and removing the label from the post.
When the label which you want to remove is removed from every post, that label is removed from your blog.
Editing All the posts one by one really a tough and boring task to do.
But we can remove the labels from more than one posts.
Hide LinkWithin Widget From Home Page Of Your Blog
LinkWithin is a good widget for keeping your visitors to your blog, but when you simply install linkwithin it spoils the look of your home page.
Basically it is not working properly in 90 percent cases.
It come to home page and spoils the look of the home page of blog.
Here I will tell you how to install linkwithin without spoiling your home page in other words how can we hide this widget from appearing on our home page.
Basically it is not working properly in 90 percent cases.
It come to home page and spoils the look of the home page of blog.
Here I will tell you how to install linkwithin without spoiling your home page in other words how can we hide this widget from appearing on our home page.
You Might Also Like Widget By Editing HTML: Blogger
If you want to keep your visitor on your blog then this widget is really a good idea.
Although I already teach you how can you add it to your blogger with LinkWithin. You can read it from below.
But this time we will not use any third party service to do this.
We will just edit our HTML Code. It is far better from using LinkWithin. Now lets see how can you add this on your blog.
Spinning Social Icons
Here some stylish social icons for you which give your blog a professional and impressive look. I am also using this social icon and I think its best.
So if you want the same then right place for you.
This is designed with CSS effects and very easy to setup in your blog.
If you are using blogger then just simply copy the following code and go to your blog layout and the select to add a gadget then select HTML/JavaScript and then on the content box paste the code and save.
Cool Subscription Box For Your Blog
Adding a subscription box below every post on your blog is quite a good idea for getting subscribers. When a visitor ends reading your article he or she will see this box.
Now how can you add it to your blog?
This is what I will teach you. Just follow these simple steps.
For this you need a feed burner account.
You Might Also Like Widget
This widget is very good for your blog, when a reader reaches the end of your post he will see this and it can be possible that he like a post from these and will open the post.
Now, let me introduce you LinkWithin.
It is a free service giving you this widget.
Download Facebook Albums In A Single Click
You want to download your friend's photo album from Facebook but its to boring to download photos one by one. I also feel the same so that here is a trick for you.
You can download your friends album with only a single click.
Let me introduce you Facebook2zip
It is an awesome service which gives you to download the whole album with a single click.
Make Any Type Of Facebook Smiley
Are you get bored with classic facebook smileys. There are only 21 default facebook smileys. But you can create any type of smiley.
f9 Set of Smileys
These are some other smileys which can be made by these codes.
[[f9.laugh]] [[f9.sad]] [[f9.angry]] [[f9.sleepy]] [[f9.shock]] [[f9.kiss]] [[f9.inlove]] [[f9.pizza]] [[f9.coffee]] [[f9.rain]] [[f9.bomb]] [[f9.sun]] [[f9.heart]] [[f9.heartbreak]] [[f9.doctor]] [[f9.ghost]] [[f9.brb]] [[f9.wine]] [[f9.gift]] [[f9.adore]] [[f9.angel]] [[f9.baloons]] [[f9.bowl]] [[f9.cake]] [[f9.callme]] [[f9.clap]] [[f9.confused]] [[f9.curllip]] [[f9.devilface]] [[f9.lying]] [[f9.rofl]] [[f9.billiard]] [[f9.cakepiece]] [[f9.rosedown]] [[f9.shutmouth]] [[f9.shy]] [[f9.silly]] [[f9.tongue1]] [[f9.fastfood]] [[f9.ring]] [[f9.plate]] [[f9.candle]]
Contact Form For Your Blog
If you want to give your blog a professional look then your blog should have a contact form. Here I will tell you to create a form for your blog.
Kontactr is an absolutely free website which allows you to create contact form for your website. Lets see how can we create a contact form for your website.Creating Contact Us Form
- Go to Kontactr and sign up for an account and activate your account and login.
- You will see a script in column under AJAX Widget, copy that code.
Protect Your Facebook Account
Todays Facebook is number one Social Networking site. Now almost every person who uses internet has a Facebook Account and now it is extremely essential for our online identification.
As we know how much facebook is important for us but still we did not take the security of of our facebook account seriously.
There are almost 60 percent facebook users who don't take the security of their facebook account seriously and that is why now days facebook accounts are hacked. So if you want to protect your facebook account then here are some tips for you.
Hide Your Blog Title From Search Results
Here is an good and effective trick for SEO for your blogger. Usually when your blogs result is viewed in Google and other search engines. They are like this:
As you can see in the image above, the blog name in every result. Now the demerit of these type of results is that when someone search something, that keyword will never match with your blog name and your blog will be in less ranking in the results and when the blog name is removed from the results, chances of matching the posts name with search keyword will increase and your blog's result will get higher ranking in search results.
Facebook Pranks
Here are some interesting Facebook Pranks for you. You can surprise or fool your friends.
Facebook Ghost
Here is an interesting website. It looks like a facebook profile. The profile image looks like a ghost and the most interesting thing that a ghost came from the wall. Just visit this link and you will get what I am saying.
http://www.sinthaistudio.com/thehouse/alrena/
Status Prank
Here is an interesting Facebook link for you all.
http://facebook.com/profile.php?=73322363
If you checked it then you are a little amazed it redirects you to your facebook home page.
Now how can you use this as a prank.
Just post a status like this:
"Hey friends The Cyber Crime Department of our city is searching for a
suspicious person. He was planning to do some bomb blasts in India.
Probably he is from a terrorist group. Probably the person's profile id
is
http://facebook.com/profile.php?=73322363
Report it."
Now when your friends will click on it they will redirect to their own homepage and will think that they are the suspect.
Read Facebook Message and Stay Undetected by Friends
If you don't want to reply some people on Facebook Chat. Now for past this was easy, just don't reply them and pretend that you did not read their message.
But Facebook has given a new function seen. When you read your friends message your friends will get a notification in their chat box that you have seen the message.
And in Facebook there is no privacy option to disable it.
Free Domain Name For Your Blog
Tired with the name .blogspot.com or .wordpress.com?
Want your own domain name?
But don't want to invest money?
Yes you can get a free domain name.
This website is providing free domain names for everyone. Yes absolute free but there is only a single demerit you can only get a domain with .tk in last. e.g. www.yourdomain.tk
This website is providing free domain names for everyone. Yes absolute free but there is only a single demerit you can only get a domain with .tk in last. e.g. www.yourdomain.tk
Install Windows XP in 15 minutes
The most famous operating system. It is still hanging as a dominant windows. It is the second most popular version of windows. Windows 8 has released but still many of the users recommend windows xp and perhaps you are also from one of them who always recommends windows xp.
Now as you know when we install windows xp it takes a lot of time about 40 minutes.
Now here is a trick for you to install it in less than 15 minutes. We can change the priority of the windows setup and then it will install more quickly.
Now as you know when we install windows xp it takes a lot of time about 40 minutes.
Now here is a trick for you to install it in less than 15 minutes. We can change the priority of the windows setup and then it will install more quickly.
Saturday, 9 March 2013
Earn Money by Referals
Yes you can earn money, it is quite easy. But one thing which I should clear you first. If you are thinking to be rich quickly and earn millions then this is probably not the right place for you. Now lets come to the point, I was searching for some website to earn money online. I have found one this is probably a very good site.
Earnyouth.com is a website that is paying for referring members.
Now what you have to do for earning from this website?
Simply go to the website by clicking here. Now Register on the website; you will get a unique referral link. Just post the link to your facebook walls and everywhere.
For every visit of your link you will get about $1.
And for every signup by your referral you will get about $3.
And for being an active member you will get about $10 weekly.
Payment Method
Once you reach $15, you can withdraw your payment by paypal and other available methods on this website.
They are providing:
1) PayPal
2) Bank Wire
3) Cheque
4) Western Union
2) Bank Wire
3) Cheque
4) Western Union
These methods to withdraw your earnings.
Now you can start earning by signing up from here.
Sunday, 10 February 2013
Fevicol Se Nagpuri Version Mp3 Download
The superhit item song from the movie Dabangg 2 named Fevical Se is now available in Nagpuri Version also. The song is from a nagpuri album named Fevicol Selem. The song is sung by some Nagpuri Artist in the same composition. The original song is from the blockbuster movie Dabangg 2, the original song is composed by Sajid Wajid and sung by Mamta Sharma and Wajid. The song was also a blockbuster in bollywood and it is also a huge hit in Jhollywood.
Download Mp3
Saturday, 9 February 2013
Main Tainu Samjhawaan Ki Unplugged by A.Rahman Mp3 Download
A. Rahman covers Main Tenu Samjhawan Ki. The Original song is sung by the legendary singer Rahat Fateh Ali Khan. The song is from the Punjabi Language Film named Virsa. Originally the song is composed by Jawed Ahmed. But the credit for this unplugged version goes to A. Rahman.
Download the audio in mp3 format
Saturday, 19 January 2013
Facebook Punch
Want to hit someone with a strong punch in Facebook? Sounds Crazy Right? But its true. Actually I am talking about an surprising chat smiley which looks like a punch coming from a wall.
Facebook Punch |
Want to surprise your friend by sending them this BOOM!! Just Copy the codes given below and send them to your friends in facebook chat box.
Facebook Punch
[[488850267812232]] [[488850257812233]] [[488850271145565]] [[488850261145566]] [[488850264478899]]
[[488850344478891]] [[488850331145559]] [[488850334478892]] [[488850337812225]] [[488850341145558]]
[[488850434478882]] [[488850424478883]] [[488850427812216]] [[488850421145550]] [[488850431145549]]
[[488850494478876]] [[488850497812209]] [[488850501145542]] [[488850504478875]] [[488850507812208]]
[[488850607812198]] [[488850611145531]] [[488850601145532]] [[488850604478865]] [[488850597812199]]
Finding Sum of Two Matrix C++ Program
This program will firstly ask the user to input the number of rows and columns of the matrix that he want to add then the program will ask to user to enter the elements of the matrix after taking the input it will display the matrix that entered with the sum.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
//variables
int r,c, mat1[10][10], mat2[10][10], sum[10][10];
int i,j;
//input part begin
cout<<"Enter the number of rows:\t";
cin>>r;
cout<<"Enter the number of columns:\t";
cin>>c;
cout<<"Enter the elements of the matrix 1:\n";
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
cout<<"Row "<<i+1<<", Column "<<j+1<<":\t";
cin>>mat1[i][j];
}
}
cout<<"Enter the elements of the matrix 2:\n";
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
cout<<"Row "<<i+1<<", Column "<<j+1<<":\t";
cin>>mat2[i][j];
}
}
//input parts end
//displaying the matrices entered
cout<<"Matrix 1:\n";
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
cout<<mat1[i][j];
cout<<"\t";
}
cout<<endl;
}
cout<<"Matrix 2:\n";
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
cout<<mat2[i][j];
cout<<"\t";
}
cout<<endl;
}
//calculation part begin
cout<<"The sum of the matrices are:\n";
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
sum[i][j]=mat1[i][j]+mat2[i][j];
}
}
//calculation part end
//displaying the sum in matrix form
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
cout<<sum[i][j];
cout<<"\t";
}
cout<<endl;
}
getch();
}
Any queries regarding this code, feel free to ask by commenting here..
C++ Program to Reverse an Integer
This program will ask user to input a number and then it will calculate the reverse of the number and print that as the output. Data type long int is used in this program.
the value of r become 0 in first line.
Then it will become 3
Now all the statements has executed so the loop will again check its expression which is again true (12 is greater than 0), so the control will again come inside the loop and will execute the statements with updated values, this process will continue until the expression in while don't become false and at last it will print the reversed value as the output.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
long int num,r=0;
cout<<"Enter an integer:\t";
cin>>num;
while(num>0)
{
r=r*10;
r=r+num%10;
num=num/10;
}
cout<<"\nThe Revers of the number is "<<r<<endl;
getch();
}
Explanation of the program
Two variables are declared one is for the number which is to be reversed and that will be defined by the user as an input and the other is r in which we will store the reverse of the number.
Now the main task is happening in the loop, while loop is used in this program.
Suppose we entered 123
Now num = 123
The expression of while loop is true (123 is greater than 0); the control will come inside the loop and will execute the following statement
r is initialized by 0 at the starting of the program, so we have the values
Now calculate what will happen Two variables are declared one is for the number which is to be reversed and that will be defined by the user as an input and the other is r in which we will store the reverse of the number.
Now the main task is happening in the loop, while loop is used in this program.
Suppose we entered 123
Now num = 123
The expression of while loop is true (123 is greater than 0); the control will come inside the loop and will execute the following statement
{
r=r*10;
r=r+num%10;
num=num/10;
}
Now dry run it in your mind. r is initialized by 0 at the starting of the program, so we have the values
r = 0;
num = 123;
the value of r become 0 in first line.
Then it will become 3
r = 0 + 123 % 10;
r = 0 + 3;
r = 3
Now in the last statement num will become 12num = 123 / 10;
num = 12
Because we have taken the data type as int so it will not take the decimal value. Now all the statements has executed so the loop will again check its expression which is again true (12 is greater than 0), so the control will again come inside the loop and will execute the statements with updated values, this process will continue until the expression in while don't become false and at last it will print the reversed value as the output.
Wednesday, 16 January 2013
Apoorva Lakhiya Reworked in Sanjay's Role in Zanjeer
New Delhi, Jan 16 (IANS) An overwhelming response to Sanjay Dutt's look in the "Zanjeer" remake has compelled director Apoorva Lakhia to rework the actor's role as Sher Khan in the film.
Sanjay plays the iconic role of Sher Khan, a character made famous by Pran in the original film.
According to source, after Sanjay's negative character as Kaancha Cheena in 'Agneepath', his new look as Sher Khan has attracted a lot of interest, therefore, the director decided to adding a song and few action sequences featuring Sanjay.
Confirming the same, Lakhia said that they will shoot for the additional scenes in February.
"Yes! He has given us extended dates and we are going to shoot in February. We are very excited about the film. I am really happy to work with Sanju sir again after 'Shootout At Lokhandwala' in 2007," Lakhia said in a statement.
Tuesday, 15 January 2013
Fibonacci Series C++ Program
#include<iostream.h> #include<conio.h> void main() { clrscr(); int a=0,b=1,c,r,i; cout<<"Enter the length:\t"; cin>>r; cout<<a<<"\t"<<b<<"\t"; for(i=0;i<r;i++) { c=a+b; cout<<c<<"\t"; a=b; b=c; } getch(); }
Why is Suniel Shetty Keeping his daughter under wraps?
Strange, but its true...Suniel and Mana Shetty's 18 years old daughter Athiya, who apparently all set to make her Bollywood debut opposite Jackie Shroff's son Tiger in Sajid Nadiawala Heropanti, is kept under wraps by her parents. In fact during her mom's new store launch, which was attended by almost entire Bollywood fraternity, Suniel requested the photographers not to take her photographs. "I requested for a picture of her, but he requested me to respect her privacy," says a photographer. While there are talks about pretty Athiya Making her debut with Tiger, interestingly Jackie, his wife Ayesha and Son Tiger were conspicuous by their absence at the launch party. Our sources say Suniel felt if Jackie and his wife were invited, it will add on to the rumours and that's why he decided not to invite them.
Monday, 14 January 2013
Calculator Program C++
This program will
Add n number of terms according to your wish,
Subtract n number of terms according to your wish,
Multiply n number of terms according to your wish,
Divide two terms,
Determine factorial of an integer and
Determine power of an integer
Add n number of terms according to your wish,
Subtract n number of terms according to your wish,
Multiply n number of terms according to your wish,
Divide two terms,
Determine factorial of an integer and
Determine power of an integer
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
class calc
{
float a,b,r,t;
int i,x,y;
long int f, p;
long double f1;
public:
void add();
void subtract();
void multiply();
void divide();
void factorial();
void power();
}cal;
void calc::add()
{
cout<<"How many terms you need to add?\n";
cin>>t;
r=0;
for(i=0;i<t;i++)
{
cout<<"Enter term "<<i+1<<":\t";
cin>>a;
r=r+a;
}
cout<<"Sum = "<<r<<endl;
}
void calc::subtract()
{
cout<<"Enter the largest term:\t";
cin>>b;
cout<<"How many terms you need to subtract?\n";
cin>>t;
r=b;
for(i=0;i<t;i++)
{
cout<<"Enter term "<<i+1<<":\t";
cin>>a;
r=r-a;
}
cout<<"Result = "<<r<<endl;
}
void calc::multiply()
{
cout<<"How many terms you need to multiply?\n";
cin>>t;
r=1;
for(i=0;i<t;i++)
{
cout<<"Enter term "<<i+1<<":\t";
cin>>a;
r=r*a;
}
cout<<"Result = "<<r<<endl;
}
void calc::divide()
{
cout<<"If you need to divide a with b then\n";
cout<<"Enter the value of a:\t";
cin>>a;
cout<<"Enter the value of b:\t";
cin>>b;
r=a/b;
cout<<"Result = "<<r<<endl;
}
void calc::factorial()
{
cout<<"Enter the value:\t";
cin>>x;
if(x<12)
{
f=1;
for(i=1;i<=x;i++)
{
f=f*i;
}
cout<<"Factorial = "<<f<<endl;
}
else
{
f1=1;
for(i=1;i<=x;i++)
{
f1=f1*i;
}
cout<<"Factorial = "<<f1<<endl;
}
}
void calc::power()
{
cout<<"Enter the base value:\t";
cin>>x;
cout<<"Enter the power value:\t";
cin>>y;
p=1;
for(i=1;i<=y;i++)
{
p=p*x;
}
cout<<endl<<x<<" to the power "<<y<<" is "<<p;
cout<<endl;
}
int main()
{
int choice;
while(1)
{
cout<<"Enter your choice\n";
cout<<"1. Addition\n2. Subtraction\n";
cout<<"3. Multiplication\n4. Division\n";
cout<<"5. Factorial\n6. Power\n7. Exit\n";
cin>>choice;
switch(choice)
{
case 1: cal.add();break;
case 2: cal.subtract();break;
case 3: cal.multiply();break;
case 4: cal.divide();break;
case 5: cal.factorial();break;
case 6: cal.power();break;
case 7: exit(0);
default: cout<<"Invalid Input\nTry Again!!\n";
}
}
}
Any confusion regarding this code then feel free to ask by commenting here... Some Exercises with Programming in C++
We learn a lot about C++ so far. Now we should try to solve some problems.
Here are the problems.
1. Write a program to make a calculator.
Here are the problems.
1. Write a program to make a calculator.
2. Write a program to print Fibonacci series.
3. Write a program to find reverse of a given number.
4. Write a program to add two matrix.
5. Write a program to multiply two matrix.
6. Write a program to find transpose of a matrix.
7. Write a program which will find sum of rows and columns in a matrix and display the result rows and column-wise in the output screen.
8. Write a program to find both right and left diagonal in a matrix and sum of the each diagonal elements.
9. Write a program to find the reverse of a string.
10. Write a program to to find the length of a string.
11. Write a program to find the characters in a string.
12. Write a program to print the string in proper case, title case, lower case and upper case.
13. Write a program to check the word is palindrome or not.
14. Write a program to check the number is palindrome or not.
15. Write a program to sort integers.
16. Pattern Programs.
3. Write a program to find reverse of a given number.
4. Write a program to add two matrix.
5. Write a program to multiply two matrix.
6. Write a program to find transpose of a matrix.
7. Write a program which will find sum of rows and columns in a matrix and display the result rows and column-wise in the output screen.
8. Write a program to find both right and left diagonal in a matrix and sum of the each diagonal elements.
9. Write a program to find the reverse of a string.
10. Write a program to to find the length of a string.
11. Write a program to find the characters in a string.
12. Write a program to print the string in proper case, title case, lower case and upper case.
13. Write a program to check the word is palindrome or not.
14. Write a program to check the number is palindrome or not.
15. Write a program to sort integers.
16. Pattern Programs.
The answers will be posted soon but you should try to solve the problems by your own.
Features of OOP
Let us look at the features,
We will make an attempt to understand the above from a logical point of view.
Encapsulation
The example of a TV set is often taken to illustrate objects and characteristics of OOP. The TV receiver is totally encapsulated. We cannot see the components inside or meddle with them. However, we can use the TV set easily. We can switch it on and select channels with the external interfaces provided in the receiver. This is the concept of encapsulation of objects in an OOP.
Wrapping together data and functions creates the objects in OOP. They are bound together. This represents encapsulation in OOP. We can use the encapsulated objects through the designated interfaces only. Thus, the inner parts of the program are sealed or encapsulated to protect from accidental tampering. This feature is not available in the conventional procedure oriented programming languages where data can be corrupted since it is easily accessible. In C++, like other object oriented programming languages such as Java and C#, encapsulation is achieved through what is known as classes.
A Class is a blueprint for making a particular kind of object, It defines the specifications for construction an object with data and function. It is generally specifies the private working of objects and their public interfaces. The data, known as data members, defines the state of the proposed object and function of its behavior.
The class is used to declare two types of members:
1. Data
2. Functions
Data are nothing but declaration of variables for holding data, Functions, called member functions, contain sequence of instructions that operate on the data. An object is nothing but a variable of type class. it is a self contained computing entity with its own data and functions. This means that an object will have its own copy of the variables. However, the functions being common to all the objects do not need to be kept in each object.
Note carefully that a class can give rise to a number of objects, but is not an object on its own. It is only a structure or blueprint which helps in creating replicas with common structures, but different characteristics. This means, two objects of a class with different names will have same variable names but with different values i.e., they have the same data type but different data. In some special cases, two objects can also have same data. A class is a framework for proper encapsulation of objects. The data members of the objects can be accessed only through the interface available in public.
Syntax for declaring a class
class class_name
{
data's;
functions;
};
Suppose we need to create a class for student the we will write
class student
{
char name[20];
int roll_no;
char sec;
public:
void student_details()
{
cout<<"Enter name:\t";
gets(name);
cout<<"Enter Roll Number:\t";
cin>>roll_no.;
cout<<"Enter Section:\t";
cin>>sec;
}
};
This is a class name student which will store a student's name, roll number and section. Now the function is declared under public, because we need a main function for the execution of program and if the function is private then main function has not the permission to access the function so your program will give an error that function is inaccessible so we need to declare the function in public. Now for accessing anything under a class you need an object of that class and that is called encapsulation. When we create object of a class all the data of that class is encapsulated under a single object called encapsulation.
class student
{
char name[20];
int roll_no;
char sec;
public:
void student_details()
{
cout<<"Enter name:\t";
gets(name);
cout<<"Enter Roll Number:\t";
cin>>roll_no.;
cout<<"Enter Section:\t";
cin>>sec;
}
};
void main()
{
student obj;
obj.student_details():
}
The syntax for creating an object is
class_name object_name;
As we did above, and for accessing anything from class the syntax is
object_of_that_class.element_of_that_class
In object part we have to write the object name which we created for that class and after than we need to place a dot ( . ) and then have to write the element which we want to access, the element can be anything from that class e.g. functions and variables. The element will only be accessible when public.
Abstraction
Data abstraction refers to, providing only essential information to the outside word and hiding their background details i.e. to represent the needed information in program without presenting the details.
For example, a database system hides certain details of how data is stored and created and maintained. Similar way, C++ classes provides different methods to the outside world without giving internal detail about those methods and data.
Data Hiding
Related to the idea of encapsulation is the concept of data hiding. Encapsulation can hide data from classes and functions in other classes. In the example of the class Transport, we can access the three data members through the member function set_values(). Although there may be many other attributes and data elements in the class Transport, these are all hidden from view. This makes programs more reliable since declaring a specific interface, such as public or private, to an object prevents inadvertent access to data in ways that it was not designed for. In C++, access to an object and its encapsulated data and functions is treated very carefully using the keywords private, protected and public. The programmer has the facility to decide the access specifications for data objects and functions as being private, protected and public while defining a class. Only when the declaration is public can other functions and objects access the object and its components without question on the other hand if the declaration is private there is no possibility of such access. When the declaration given is protected, access to data and functions in a class by others is not as free as when it is public, not as restricted as when it is private. You can declare one base class as being derived from another, which will be discussed shortly.
Inheritance
A software object does not exist by itself; it is always an instance of a class. A class gives a blueprint for building a software object and can inherit the features of another class and add its own modifications. Inheritance is similar to human beings. A child can inherit his/her father's property and add/acquire more properties; he/she can modify the inherited property; or dispose of a property. In a similar manner, a new class can inherit its properties from another existing class.
A class can have a child, which means one class can be derived from another. The original or parent class is known as the base class and the child class is known as the derived class.
Polymorphism
Polymorphism is a useful concept in OOP languages, In simple terms it means one name, many duties. It provides a common interface to carry out similar tasks. In other words, a common interface is created for accessing related objects. This facilitates the objects to become interchangeable black boxes. hence they can be used in other programs as well. Therefore, polymorphism enables reuse of objects built with a common interface.
Overloading
The concept of overloading is also a branch of polymorphism. When the exiting operator or function is made to operate on new data type it is said to be overloaded.
Atif Aslam Promotional Songs Download
The Pakistani super star has sung a number of promotional songs for various products in India and Pakistan. Here we are uploading those songs in mp3 format.
Promotional Songs by Atif Aslam(Click on the Song to Download)
1. Jee Lay Zindagi by Atif Aslam
2. Juru Gey to Jano Gey by Atif Aslam
3. Hum Mustafavi Hain by Atif Aslam and Dawood ali
Post will update soon...
Promotional Songs by Atif Aslam(Click on the Song to Download)
1. Jee Lay Zindagi by Atif Aslam
2. Juru Gey to Jano Gey by Atif Aslam
3. Hum Mustafavi Hain by Atif Aslam and Dawood ali
Post will update soon...
Sunday, 13 January 2013
Atif Aslam and Slash: Wish You Were Here Mp3 Download
Atif Aslam performed "Wish you were here" by Pink Floyd live with the former members of the American hard rock band Guns N' Roses - Slash, Matt Sorum and Gilby Clarke as well as with Shaun Lenon and Lanny Cordola at the "Best Buy Theatre" in New York City.
Download the audio version of that live performance from the link given below. Click on the song to download.
Object Oriented Programming Systems
Object Oriented Programming Systems (OOPS) are widely used in software development projects. C++ is one of the early OOPS. Using OOPS for program development reduces programming errors and improves their quality. Representing objects of the real world as software objects in OOPS is quite a natural way for program development. The introductory section brings out the characteristics of OOPs and, in particular the three basic characteristics, which are:
1. Encapsulation
2. Inheritance
3. Polymorphism
Object Oriented Programming
The prime purpose of C++ programming was to add object orientation to the C programming language, which is in itself one of the most powerful programming languages.
The core of the pure object-oriented programming is to create an object, in code, that has certain properties and methods. While designing C++ modules, we try to see whole world in the form of objects. For example a car is an object which has certain properties such as color, number of doors, and the like. It also has certain methods such as accelerate, brake, and so on.
Advantages of OOP
Re-usability
It refers to the ability for multiple programmers to use existing written and debugged classes in their programs. This is a time saving and quality improvement mechanism that adds coding efficiency to a language. Moreover, the programmer can incorporate new features into an existing class, further developing the application and allowing users to achieve improved performance. This time saving feature optimizes code, helps to gain secured applications and facilitates easier maintenance of applications. Object oriented programs are designed for reuse. The features which facilitate ease of reuse, are encapsulation and inheritance.
Maintainability
Since each class is self contained with data and functions and also the functions are grouped together, these programs are easily maintainable. Encapsulation enhances maintainability of programs.
Natural
The software objects represent the real objects in the problem domain and hence the programming is quite natural to reality. They can be given real names such as transport, cycle, etc. thereby enhancing understand-ability of the code.
Modular
Modularity is unique not only to OOP, but to function oriented programming as well. Modularity in OOP is facilitated through the division of a program into well defined and closely knit classes. Thus, any complex program can be divided or partitioned into modules, and the divide and conquer strategy can be used for program design through modularization of the code through classes.
Extensibility
The inheritance mechanism of OOP facilitates easy extension of the features of classes. Thus, old and proven code can be extended easily through the inheritance property of OOP.
Data Integrity
Avoiding global variables, goto statements and binding the data within the class ensures data integrity and restricted access - which is the very purpose of OOP.
Improved Quality
One of the objectives of OOP is to improve the quality of programs. C++ constructs reduce the chances of programming errors with their inbuilt modularity and re-usability.
1. Encapsulation
2. Inheritance
3. Polymorphism
Object Oriented Programming
The prime purpose of C++ programming was to add object orientation to the C programming language, which is in itself one of the most powerful programming languages.
The core of the pure object-oriented programming is to create an object, in code, that has certain properties and methods. While designing C++ modules, we try to see whole world in the form of objects. For example a car is an object which has certain properties such as color, number of doors, and the like. It also has certain methods such as accelerate, brake, and so on.
Advantages of OOP
Re-usability
It refers to the ability for multiple programmers to use existing written and debugged classes in their programs. This is a time saving and quality improvement mechanism that adds coding efficiency to a language. Moreover, the programmer can incorporate new features into an existing class, further developing the application and allowing users to achieve improved performance. This time saving feature optimizes code, helps to gain secured applications and facilitates easier maintenance of applications. Object oriented programs are designed for reuse. The features which facilitate ease of reuse, are encapsulation and inheritance.
Maintainability
Since each class is self contained with data and functions and also the functions are grouped together, these programs are easily maintainable. Encapsulation enhances maintainability of programs.
Natural
The software objects represent the real objects in the problem domain and hence the programming is quite natural to reality. They can be given real names such as transport, cycle, etc. thereby enhancing understand-ability of the code.
Modular
Modularity is unique not only to OOP, but to function oriented programming as well. Modularity in OOP is facilitated through the division of a program into well defined and closely knit classes. Thus, any complex program can be divided or partitioned into modules, and the divide and conquer strategy can be used for program design through modularization of the code through classes.
Extensibility
The inheritance mechanism of OOP facilitates easy extension of the features of classes. Thus, old and proven code can be extended easily through the inheritance property of OOP.
Data Integrity
Avoiding global variables, goto statements and binding the data within the class ensures data integrity and restricted access - which is the very purpose of OOP.
Improved Quality
One of the objectives of OOP is to improve the quality of programs. C++ constructs reduce the chances of programming errors with their inbuilt modularity and re-usability.
String
More than one character is called as a string. Suppose we need to store a name on a variable, but we can only store a single character by declaring a char type variable so if we need to store a name then we have to use character array.
In getline the syntax is
cin.getline(variable_name,size)
Every string is terminated with NULL ('\0') character, so if we are declaring a character array of size 30, we can store only 29 characters on it because the last space is reserved for NULL character.
Lets Understand it with a program
Write a program to find the length and reverse of a string.
One character array of size 30, two integer variables i for loop and l for counting length.
At first user gets a message that enter a string and we took input from the gets function by passing the variable name as the parameter.
Suppose we entered
belal haque khan
Now for loop, i is initialized with 0, and then the conditions (string[i] != NULL) is checked which is true (string[0] = b and it is not equals to NULL), so because the condition is true control will come inside the loop and will increment l by 1, so the value of l was 0 and it will become 1, now the i will increment by 1 and will become 1, again the condition will checked which is true again and control will again come inside the loop and increment l by 1, this process will continue until the value of string[i] will not become NULL.
Now the length is stored in l, we have printed the the length on the output screen now we need to print the reverse of the screen for this we have to start the array index from l (the length we calculated) and we have to print the each value from the back, for this we took the help of the loop.
The loop is initialized with l (i = l) and l = 16 (calculated in the first loop), now the control will check the condition ( i >= 0 ) which is true (16 is greater than 0 ) the control will come inside the loop and print the value of string[i], the value of i is currently 16 so it will print the value of string[16]. Now the value of i is decremented by 1 and will became 15, again the control will check the condition which is true (15 is greater than 0) again control will come inside loop and will print the value of string[15], again the value of i will be decremented by 1 and again the control will checks the condition this process will repeat until the condition will not become false.
char name[30];
Now we can store a name in it, but how can we take the input, cin will not accept space so we can't take input by cin for a sentence or some words, cin can be only used for a single word, we can use looping, we can also take input by using function gets or getline, this would be more easier. gets(name);
cin.getline(name,30)
In gets we have to pass the variable name as the parameter in gets function, this function is defined under the header file stdio.h, so if you are using it you must define the header file to avoid error. In getline the syntax is
cin.getline(variable_name,size)
Every string is terminated with NULL ('\0') character, so if we are declaring a character array of size 30, we can store only 29 characters on it because the last space is reserved for NULL character.
Lets Understand it with a program
Write a program to find the length and reverse of a string.
#include<iostream.h> #include<stdio.h> #include<conio.h> void main() { clrscr(); char string[30]; int i,l=0; cout<<"Enter a string:\t"; gets(string); for(i=0;string[i]!=NULL;i++) { l++; } cout<<"The Length is "<<l<<endl; for(i=l;i>=0;i--) { cout<<string[i]; } getch(); }
Explanation of the Program
Variable declares are:One character array of size 30, two integer variables i for loop and l for counting length.
At first user gets a message that enter a string and we took input from the gets function by passing the variable name as the parameter.
Suppose we entered
belal haque khan
Now for loop, i is initialized with 0, and then the conditions (string[i] != NULL) is checked which is true (string[0] = b and it is not equals to NULL), so because the condition is true control will come inside the loop and will increment l by 1, so the value of l was 0 and it will become 1, now the i will increment by 1 and will become 1, again the condition will checked which is true again and control will again come inside the loop and increment l by 1, this process will continue until the value of string[i] will not become NULL.
Now the length is stored in l, we have printed the the length on the output screen now we need to print the reverse of the screen for this we have to start the array index from l (the length we calculated) and we have to print the each value from the back, for this we took the help of the loop.
The loop is initialized with l (i = l) and l = 16 (calculated in the first loop), now the control will check the condition ( i >= 0 ) which is true (16 is greater than 0 ) the control will come inside the loop and print the value of string[i], the value of i is currently 16 so it will print the value of string[16]. Now the value of i is decremented by 1 and will became 15, again the control will check the condition which is true (15 is greater than 0) again control will come inside loop and will print the value of string[15], again the value of i will be decremented by 1 and again the control will checks the condition this process will repeat until the condition will not become false.
Output of the Program |
Double Dimension Array
A double dimension array is a matrix type in which we can store values in matrix form.
Syntax
Lets understand it with a program
Write a program to print a matrix according to user's choice.
The above program has one double dimension array variable of integer data type which can store matrix upto 10 x 10, and four integers variables i,j,r,c.
int matrix[10][10]; //for matrix
int i, j; //for loops
int r,c; //for rows and columns
At first we give the message to the user that enter the values of rows and columns and take the inputs and stored the values in variables r and c.
Now the program has two phases one is input phase in which we take the values from the user and second is output phase in which we display the values to the output screen in matrix form.
Suppose r = c = 2;
Input
Nested looping is used for taking the values the outer loop is initialized with i = 0, this loop is for the rows. Now as the loop works i is initialized with 0 and now it will check the condition (i < r) which is true (0 is less than 2), the control will come inside the loop.
Now the second inner loop j is initialized with 0 (j = 0), it will again checks for the condition (j < c) which is true (0 is less than 2) so the control will come inside the loop and will give the message to the user that
enter row i + 1 (0 + 1) col j + 1 (0 + 1) :
i.e.
enter row 1 col 1:
and will take a value and store it in the matrix[i][j]
The values are currently i = 0, j = 0;
so the value will be stored in matrix[0][0]
Now the j in the inner loop will be incremented by 1 and become 1, again it will checks for the condition which is true (1 is less than 2)
again it will take a value and store it in the matrix [i][j]
the values are currently i = 0; j = 1;
so the value will be stored in matrix[0][1]
Now again the j in the inner loop will be incremented by 1 and become 2, again it will checks for the condition which is false (2 is not less than 2).
Now the condition became false so it will again go to the outer loop.
The i will incremented by 1 and became 1, again the outer loop will checks for the condition which is true (1 is less than 2), the control again come inside loop and will come to the inner loop.
Inner loop will again initialized with 0 and will checks for the condition which is true (0 is less than 2) the control will again come inside the inner loop and takes the value and store it in matrix[i][j]
the values are currently i = 1; j = 0;
so the value will be stored in matrix[1][0]
Now the j in the inner loop will be incremented by 1 and become 1, again it will checks for the condition which is true (1 is less than 2)
again it will take a value and store it in the matrix [i][j]
the values are currently i = 1; j = 1;
so the value will be stored in matrix[1][1]
Now again the j in the inner loop will be incremented by 1 and become 2, again it will checks for the condition which is false (2 is not less than 2).
Now the condition became false so it will again go to the outer loop.
The i will incremented by 1 and became 2, again the outer loop will checks for the condition which is false (2 is not less than 2), now the first phase is completed input is over.
Output
Output is almost same as input same nested looping will be used but just the place of input we have to place an output function (cout) and after printing we have to place a tab ("\t") and when one round of inner loop is completed we need to place a new line (endl) then it will be printed in the matrix format.
Syntax
data_type array_name[row_size][column_size];
The array index starts from zero, same concept is applied here suppose we want to create a 3 x 3 matrix for storing value of name matrix then the syntaxint matrix[3][3];
The value it will store in the matrix forma[00] a[01] a[02]a[10] a[11] a[12]a[20] a[21] a[22]
Lets understand it with a program
Write a program to print a matrix according to user's choice.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,r,c;
int matrix[10][10];
cout<<"Enter rows and cols:\t";
cin>>r>>c;
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
cout<<"Enter row "<<i+1<<" col "<<j+1<<":";
cin>>matrix[i][j];
}
}
cout<<endl<<"The matrix entered:\n";
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
cout<<matrix[i][j];
cout<<"\t";
}
cout<<endl;
}
getch();
}
Explanation of the programThe above program has one double dimension array variable of integer data type which can store matrix upto 10 x 10, and four integers variables i,j,r,c.
int matrix[10][10]; //for matrix
int i, j; //for loops
int r,c; //for rows and columns
At first we give the message to the user that enter the values of rows and columns and take the inputs and stored the values in variables r and c.
Now the program has two phases one is input phase in which we take the values from the user and second is output phase in which we display the values to the output screen in matrix form.
Suppose r = c = 2;
Input
Nested looping is used for taking the values the outer loop is initialized with i = 0, this loop is for the rows. Now as the loop works i is initialized with 0 and now it will check the condition (i < r) which is true (0 is less than 2), the control will come inside the loop.
Now the second inner loop j is initialized with 0 (j = 0), it will again checks for the condition (j < c) which is true (0 is less than 2) so the control will come inside the loop and will give the message to the user that
enter row i + 1 (0 + 1) col j + 1 (0 + 1) :
i.e.
enter row 1 col 1:
and will take a value and store it in the matrix[i][j]
The values are currently i = 0, j = 0;
so the value will be stored in matrix[0][0]
Now the j in the inner loop will be incremented by 1 and become 1, again it will checks for the condition which is true (1 is less than 2)
again it will take a value and store it in the matrix [i][j]
the values are currently i = 0; j = 1;
so the value will be stored in matrix[0][1]
Now again the j in the inner loop will be incremented by 1 and become 2, again it will checks for the condition which is false (2 is not less than 2).
Now the condition became false so it will again go to the outer loop.
The i will incremented by 1 and became 1, again the outer loop will checks for the condition which is true (1 is less than 2), the control again come inside loop and will come to the inner loop.
Inner loop will again initialized with 0 and will checks for the condition which is true (0 is less than 2) the control will again come inside the inner loop and takes the value and store it in matrix[i][j]
the values are currently i = 1; j = 0;
so the value will be stored in matrix[1][0]
Now the j in the inner loop will be incremented by 1 and become 1, again it will checks for the condition which is true (1 is less than 2)
again it will take a value and store it in the matrix [i][j]
the values are currently i = 1; j = 1;
so the value will be stored in matrix[1][1]
Now again the j in the inner loop will be incremented by 1 and become 2, again it will checks for the condition which is false (2 is not less than 2).
Now the condition became false so it will again go to the outer loop.
The i will incremented by 1 and became 2, again the outer loop will checks for the condition which is false (2 is not less than 2), now the first phase is completed input is over.
Output
Output is almost same as input same nested looping will be used but just the place of input we have to place an output function (cout) and after printing we have to place a tab ("\t") and when one round of inner loop is completed we need to place a new line (endl) then it will be printed in the matrix format.
Output of the Progam |
Subscribe to:
Posts (Atom)