Monday 6 January 2014

staff delete and update example

#include<iostream.h>
#include<string.h>
class Staff{
            protected:
                char id[10];
                char name[20];
                long salary;
            public:
                void input();
                void output();
                long getSalary();
                long setSalary();
};
void Staff::input()
        {cout<<"Id: ";cin.seekg(0,ios::end);cin.get(id,10);
         cout<<"Name: ";cin>>name;
         cout<<"Salary: ";cin>>salary;
        }
void Staff::output()
        {cout<<id<<"\t"<<name<<"\t"<<salary<<"\t"<<endl;
        }
long Staff::setSalary()
        {return salary;
        }
long Staff::getSalary()
        {return salary;}
void deleteSalary(Staff s[],int n)
        {int sa;
            cout<<"Delte salary: ";cin>>sa;
            for(int i=0;i<n;i++)
                if(s[i].getSalary()==sa)
                { n=n-1;
                  for(int j=i;j<n;j++)
                        s[j]=s[j+1];
                  i--;
                }
            cout<<"Id\tName\tSalary"<<endl;
            for(i=0;i<n;i++)
            {s[i].output();
            }
         }
void sortSalary(Staff s[],int n)
        {
         for(int i=0;i<n-1;i++)
            for(int j=i+1;j<n;j++)
                if(s[i].getSalary()>s[j].getSalary())
                  {Staff tmp=s[i];
                      s[i]=s[j];
                      s[j]=tmp;
                  }
             cout<<"Id\tName\tSalary"<<endl;
            for(i=0;i<n;i++)
            {s[i].output();
            }
         }
void updateSalary(Staff s[],int n)
        {int sa1;
         cout<<"Update Salary: ";cin>>sa1;
         for(int i=0;i<n;i++)
            if(s[i].getSalary()==sa1)
                {
                 cout<<"New Salary: ";cin>>s[i].setSalary();
                }
         for(i=0;i<n;i++)
            {s[i].output();
            }
        }
void main()
{ Staff st[50];
  int n,sw;
  cout<<"Number of Staff: ";cin>>n;
  for(int i=0;i<n;i++)
  {st[i].input();
  }
  cout<<"Press '1' for Sorting Salary."<<endl;
  cout<<"Press '2' for Deleting salary."<<endl;
  cout<<"Press '3' for Update salary."<<endl;
  loop:
  cout<<"Please choose one of them: ";cin>>sw;
  switch(sw)
  { case 1:     sortSalary(st,n);
                    break;
     case 2:    deleteSalary(st,n);
                    break;
     case 3:    updateSalary(st,n);
                    break;
     default:     cout<<"Please choose again."<<endl;
                    goto loop;
                    break;
  }
}

Sunday 22 December 2013

Odesk Seo Test Answers 2013-2014



1. Some words, when followed by a colon, have special meanings to yahoo. What is performed by the link:Operator?

a. it shows all the outbound links from the url
b. It shows how many pages of the site yahoo is pointing to
c.It shows all the pages that point to that url
d. It show url's with broken links

answer: C

2. Which blackhat Seo techniques is characterized by a method to deceive search engine, by detecting the search engine bot and "feeding" it with a different HTML code than the HTML actually served to users?

a.Coaling
b.Foisting
c.Slighting
d.Cloaking

answer: D

3. Why is it bad idea from SEO perspective to host free articles and write ups that are very common on the internet?

a.Because they will not lead to fresh traffic
b.Because you could be penalize by search engine for using duplicate contents
c.Because you will not get the benefits of proper keyword targeting
d.because people could turn up claiming copyright infirigement

answer: B

4. What will happen if you type the word 'Certification-Networking' in the google search box?

a.Google will find the web pages about "certification" and also containing the word "networking"
b.Google will find ALL the web pages containing the word word "Certification" and "Networking"
c.Google will find ALL the web pages in which the words "Certification" and "Networking" appear together.
d.Google will find the web pages about Certification that do not contain the word Networking

answer: C

5. Which of the following factors does google take into account while accessing whether or not a website is an authority website?

a. The frequency with which the contents of the website is updated
b. the number of web pages containing relevant information on the main theme of the website
c.The number of in-bound natural links related to the website's theme (or keywords)
d. None of the above

answer: C


6. What is keyword density?

a.The number of times the keyword is used / (divided by) the total word count on page - (minus) the total words in HTML on the page
b.The number of times the keyword is used x (multiply by) the total word count on page.
c.The number of times the keyword is used in the page description
d.The number of times the keyword is used in the page title
e.The number of times the keyword is used / (divided by) the total word count on the page.

answer: E

7. Which of the following statement about FFA pages are true?

a.They are greatly beneficial to SEO
b.They are also called Link Farms
c.They are Paid Listings
d.They contain numerous inbound links

answer: B

8. What is the illegal act of copying of a page by unauthorized parties in order to filter off traffic to another site called?

a.Traffic jacking
b.Visitors Jacking
c.View Jacking
d. Page Jacking

answer: D

9. What is the most likely time period required for getting a google page ranking?

a.1 week
b. 3 weeks
c. 1 month
d. More than 3 months

answer: D

10. Which of the following can be termed as a good keyword selection and placement strategies?

a.Targeting synonyms of the main keyword, A & D
b.Targeting the highest searched keywords only
c.Copying competitor keywords
d.Optimizing 5 or more keywords per page (check)

answer: A

11. Some words, when followed by a colon, have special meanings to yahoo. What is perfermed by the link:Operator?

a. it shows all the outbound links from the url
b. It shows how many pages of the site yahoo is pointing to
c. It shows all the pages that point to that url
d. It show url's with broken links
answer: C

12. Which blackhat Seo techniques is characterized by a method to decieve search engine, by detecting the search engine bot and "feeding" it with a different HTML code than the HTML actually served to users?

a.Coaling
b.Foisting
c.Slighting
d.Cloaking

answer: D

13. Why is it bad idea from SEO perspective to host free articles and write ups that are very common on the internet?

a.Because they will not lead to fresh traffic
b.Because you could be penalize by search engine for using duplicate contents
c.Because you will not get the benefits of proper keyword targeting
d.because people could turn up claiming copyright infirigement

answer: B

14. What will happen if you type the word 'Certification-Networking' in the google search box?

a.Google will find the web pages about "certification" and also containing the word "networking"
b.Google will find ALL the web pages containing the word word "Certification" and "Networking"
c.Google will find ALL the web pages in which the words "Certification" and "Networking" appear together.
d.Google will find the web pages about Certification that do not contain the word Networking

answer: C

15. Which of the following factors does google take into account while accessing whether or not a website is an authority website?

a. The frequency with which the contents of the website is updated
b. the number of web pages containing relevant information on the main theme of the website
c.The number of in-bound natural links related to the website's theme (or keywords)
d. None of the above

answer: C

16. What is keyword density?

a.The number of times the keyword is used / (divided by) the total word count on page - (minus) the total words in HTML on the page
b.The number of times the keyword is used x (multiply by) the total word count on page.
c.The number of times the keyword is used in the page description
d.The number of times the keyword is used in the page title
e.The number of times the keyword is used / (divided by) the total word count on the page.

answer: E

17. Which of the following statement about FFA pages are true?

a.They are greatly beneficial to SEO
b.They are also called Link Farms
c.They are Paid Listings
d.They contain numerous inbound links

answer: B

18. What is the illegal act of copying of a page by unauthorized parties in order to filter off traffic to another site called?

a.Traffic jacking
b.Visitors Jacking
c.View Jacking
d. Page Jacking

answer:D

19. What is the most likely time period required for getting a google page ranking?

a.1 week
b. 3 weeks
c. 1 month
d. More than 3 months

answer: D

20. Which of the following can be termed as a good keyword selection and placement strategies?

a. Targeting synonyms of the main keyword (ans) A & D
b.Targeting the highest searched keywords only
c.Copying competitor keywords
d*Optimizing 5 or more keywords per page (check)

answer: D

21. Google displays up to ------------------------ characters of a web pages title tag

a.56
b.60 * B & C
c.66
d.80

answer: B

22. Which of the following fact about Alexa are correct ?

a.Alexa provides free data on relative website visitors traffic
b. Alexa and Quancast provide information on visitors household income
c.Alexa is baised towards US based traffic
d.Quantcast only track people who have installed the quantcast toolbar

answer: A

23. What is the name of the search engine technology due to which a query for the word "actor" will aslo show search result for related word such as actress, acting or act?

a.Spreading
b.Dilating
c.RSD (real time synonyms detection)
d.Stemming
e.Branching

answer: D

24.Do search engine such as google detect unnatural linking patterns by checking the class C IP address of the page where the link to the website originates

a. Yes
b. No

answer: A

25. Which of the following conditions will google treat favorably from the "Relevancy" perspective.

a.The website offering product and services to the visitors country
b.A website that provides Free content for related keywords
c.Hidden keywords on the homepage matching search term
d.Image alt tag on the homepage matching search term

answer: B

26. Which of the following website design guideline has been recommended by google?

a.Having a clear hierachy and text links
b.Every page should be reachable from atleast one static text link
c.If the sitemap is larger than 100 or so links, you should break the sitemap into separate pages
d.Keep the links on a given page to a reasonable number (fewer than 100)
e. Use less than 30 images or graphics per page

answer: A

27. What is the main reason for the effectiveness of Optimizing a web page towards a long tails keyword search? Recheck

a.There are more long tail searches than shorter keyword queries
b.*Search engine often pass on long tail searches to lesser or new website
c.Search engine do not pass on long tail search traffic to website that rank high for shorter keyword searches (check)
d.There are fewer webvsite that have targeted such keyword's

answer: D

28 Which of the following statement is correct with regard's to the images within a web page?

a.Images can not be spidered by the search engine (check)
b.Important keywords related to the image should be plcaed in the ALT text
c.Images should always be kept close to the top of a web page
d. Image maps should be used while including the images

answer: B

29. What does the 302 server Response Code signify?

a.It signifies conflict, too many people wanting the same file at the same time
b.The page has been permanently removed
c.The method you are using to access the file is not allowed
d.The page has temporarily moved
e.What you requested is just too big to process

answer: D


30. State whether the following statement is true or false. A sitemap provide a list of natural links to user accessible pages on a website

a.True
b.False

answer: B

31.  State whether true or false.
The Yahoo Directory listing is a free service for commercial site?

a.True
b.False

answer: A