BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Right Header

Register FAQ Community Calendar New Posts Navbar Right Corner
HOME BZU Mail Box Online Games Radio and TV Cricket All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan > Institute of Computing > Bachelor of Science in Computer Science > BsCS 6th Semester > Visual Programming


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 17-06-2011, 09:50 PM
thecool's Avatar
Senior Member


 
Join Date: Apr 2009
Location: Multan
Posts: 1,163
Contact Number: Push me a PM if you really need
Program / Discipline: Alumni
Class Roll Number: ---
thecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond repute
Exclamation inheritance | example | source code in C sharp

inheritance | example | source code in C sharp

Code:
using System;
using System.Collections.Generic;
using System.Text;

namespace inh_sing
{
public class person
{
public string phone,name,address;
public void getp()
{
Console.WriteLine("Enter name:");
name=Console.ReadLine();

Console.WriteLine("Enter address:");
address = Console.ReadLine();

Console.WriteLine("Enter phone:");
phone = Console.ReadLine(); 


}
}

public class stud:person
{
public string course;
public int roll;
public void gets()
{
Console.WriteLine("Enter rollno:");
roll = int.Parse (Console.ReadLine());
Console.WriteLine("Enter course:");
course = Console.ReadLine();
}

public void display()
{
Console.WriteLine("Roll No:-" + roll);
Console.WriteLine("Name:-" + name);
Console.WriteLine("Course:-" + course);
Console.WriteLine("Address:-" + address);
Console.WriteLine("Phone:-" + phone);
}
}


public static void Main(string[] args)
{
stud s1 = new stud();
s1.getp();
s1.gets();
s1.display();
Console.ReadLine();
}
}
}

Reply With Quote
Reply

Tags
code, inheritance, sharp, source


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Site for premade Projects, Planet Source Code .BZU. User links/Others sites links 1 17-06-2011 09:48 PM
Lesson 20: Inheritance - Syntax bonfire Introduction to Computing 0 26-02-2011 10:48 PM
Lesson 19: Inheritance - An Overview bonfire Introduction to Computing 0 26-02-2011 10:47 PM

Best view in Firefox
Almuslimeen.info | BZU Multan | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 09:05 AM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.