Author Topic: Programmers, Webmasters & Internet...  (Read 2649 times)

0 Members and 1 Guest are viewing this topic.

Offline Dante

  • Sr. Member
  • ****
  • Join Date: Jan 2004
  • Location: Arewa ta kudu
  • Posts: 363
  • Gender: Male
    • View Profile
    • http://www.muntata.2ya.com/
Programmers, Webmasters & Internet...
« on: January 19, 2004, 04:25:44 PM »
A spot for creating,developing ideas and context for teaching the fundamentals of computer programming and what we know in creating website..
 
If you are a computer programmer or webmaster, this is a place to share your knowledge with others.
_________________________
Gaskiya tafi komai..........هو الذي

Offline ajingi

  • Sr. Member
  • ****
  • Join Date: Feb 2004
  • Location: North
  • Posts: 272
    • View Profile
Re: Programmers, Webmasters & Internet...
« Reply #1 on: March 09, 2004, 12:42:45 PM »
Sallam,
This forum sound interesting in educating and enlighting members in area of technology, especially computer science. Let us start posting codes in different programming languages to share our knolwedege. Please, correction is highly recognised from you.
 
To creating a basic template for book and magazine in your personal library. following this code, if you are through in C++ or a beginner.
 
class lib# include<iostream.h>
# include<conio.h>
// Creating a basic template for book and magazine
class lib
{
 private:
  char title[20];
  char pub[20];
  unsigned int acc_no;
 public:
//method for getting inputs
  void get_details()
  {
  cout<<"Enter the book title"<<endl;
  cin>>title;
  cout<<"Enter the publisher name"<<endl;
  cin>>pub;
  cout<<"Enter the accession number"<<endl;
  cin>>acc_no;
  }
//method for showing output
  void show_details()
  {
  cout<<"Title : "<<title<<endl;
  cout<<"Publisher : "<<pub<<endl;
  cout<<"Accession No. : "<<acc_no<<endl;
  }
};
// Class Book derived from lib
class book :  private lib
{
private:
 char author[20];
public:
 void get_details()
 {
 lib::get_details();
 cout<<"Enter the author's name: "<<endl;
 cin>>author;
 }
 void show_details()
 {
 lib::show_details();
 cout<<"Autohr : "<<author<<endl;
 }
};
//Class for Magazine derived from lib
class magz :  private lib
{
private:
 char editor[20];
public:
 void get_details()
 {
 lib::get_details();
 cout<<"Enter the editor's name: "<<endl;
 cin>>editor;
 }
 void show_details()
 {
 lib::show_details();
 cout<<"editor : "<<editor<<endl;
 }
};
void main(void)
{
clrscr();
//creating objects
book b;
magz m;
b.get_details();
m.get_details();
b.show_details();
m.show_details();
getch();
}
I object to violence because when it appears to do good, the good is only temporary; the evil it does is permanent.

 


Powered by EzPortal