Categories
Uncategorised

Constructors – Person Data

/* Copyright © 2007 Ankur Banerjee. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. http://www.fsf.org/licensing/licenses/lgpl.html /

/ Constructors – Person Data /

#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>

int flag = 0;

class address
{
char name[20], street[15], city[20], state[15];
int houseno;
public:
address()
{
houseno = 0;
strcpy(name, ”);
strcpy(street, ”);
strcpy(city, ”);
strcpy(state, ”);
}
address(int num, char n[20], char st[15])
{
houseno = num;
strcpy(name, n);
strcpy(street, st);
strcpy(city, “Delhi”);
strcpy(state, “India”);
}
void disp(char n[20])
{
if (strcmp(n, name) == 0)
{
cout<<endl<<“Name : “<<name<<endl
<<“House number : “<<houseno<<endl
<<“Street : “<<street<<endl
<<“City : “<<city<<endl
<<“State : “<<state<<endl;
flag = 1;
}
}
} ;

void main()
{
clrscr();
int h;
char n[20], st[15];
cout<<endl<<“Enter house number : “;
cin>>h;
cout<<“Enter name : “;
gets(n);
cout<<“Enter street : “;
gets(st);
address ad (h, n, st);
cout<<“Enter the same name again : “;
gets(n);
ad.disp(n);
if (flag == 0)
cout<<endl<<“Moron, I said enter the SAME name!”<<endl;
getch();
}

/ Output */

Enter house number : 42
Enter name : Arthur Dent
Enter street : 42, Guide Road
Enter the same name again : Arthur Dent

Name : Arthur Dent
House number : 42
Street : 42, Guide Road
City : Delhi
State : India

Categories
Reviews

More On My Favoritestest Band

What’s the best-selling album ever? That’s the question some guy asked at Ask Yahoo! today. And [shudder], I hope the spirit of The Hitchhiker’s Guide to the Galaxy forgives me, for (as even Ask Y! thought earlier) even I thought it was Wacko Jacko’s Thriller. Nada. That’s not correct! This is what Ask Y! team has to say:

The high-flying Eagles are the real champs of the charts. According to the Recording Industry Association of America, “Their Greatest Hits 1971-1975” by the Eagles is the best-selling album ever with 29 million copies sold. Jacko’s “Thriller” is second, followed by “Led Zeppelin IV,” Pink Floyd’s “The Wall,” and AC/DC’s “Back in Black.” It’s unlikely the Eagles will ever be surpassed.

Surprised? Hmmm. Maybe I shouldn’t be. After all, since I came to know that the official h2g2 theme is by the Eagles, they’ve become the greatest band of all time for me. BTW, except for Jacko, the other ones mentioned are among my top favorites too. In other news, I am still hunting for the original album. Ah, wish it was a 1942 album, that’d have made it tougher to find, but the significance of the year…

Once again, Yahoo! made me discover something life-altering that I never knew about. Yahoo! rules!