Technology Guruu

  • Home
  • Site Info
    • About Us
    • Disclaimer
    • Privacy Polacy
  • Home
  • Digital Marketing
    • SEO
    • SMM
    • SEM
  • Quotes
  • Technical
  • Java
  • .Net
    • C#.Net
    • ASP.Net
  • Keychains

Monday, 4 April 2016

Example For Inheritance in C#.Net

 Akansha     11:00:00     TechnicalQuestions     No comments   

.Net is a frame work it is a software in this we are execute 64+ languages like C#.net,vb.net,Asp.net etc.Now a days every company develop projects through ms.net.So,The top MNC companies concentrate only on ms.net and in the interview purpose asking more on ms.net.so we definitely know the ms.net so we are placed what are the frequently asked questions and impressed answers.Friends don't blindly follow the answers for questions first know the topic after that you are ready/prepare your answers for the questions and perform that answers in every interview.First i tension i understand the topic but i can't perform interview what i prepare, i think one day why i lose my interview i know the all answers on that day i find out the reason because i am not saying my answer in my proper understand manner.After that i am not repeated that mistake now i get the good job.So friends so many also having these problem so you want full description about any topic you are seen previous articles and you want questions follow this article.All the best for your Interview.

C#.Net Logical Program

examples

Q)Write a Program for Student Details Using Inheritance?

using System;
namespace HirerichialExample
{
class Person
{
int no;
string name;
public Person(int no,string name)
{
this.no = no;
this.name = name;
}
public void Pdetails()
{
Console.WriteLine("identification number is : \t " + no + "\nidentification name is :\t " + name);
}
}
class Employee:Person
{
int eno; string ename; double bsal;
public Employee(int eno,string ename,double bsal):base(eno,ename)
{
this.eno=eno;
this.ename=ename;
this.bsal=bsal;
}
public void Totsal()
{
Pdetails();
double tsal = bsal + bsal * 0.2 + bsal * 0.4;
Console.WriteLine("TOTAL SAL IS : \t"+tsal);
}
}
class Student:Person
{
int sno; string sname; int m1,m2,m3; double tot; double per;
public Student(int sno,string sname,int m1,int m2,int m3):base(sno,sname)
{
this.sno=sno;
this.sname=sname;
this.m1=m1;
this.m2 = m2;
this.m3 = m3;
}
public void Tot()
{
Pdetails();
tot = m1 + m2 + m3;
Console.WriteLine("total is : \t" + tot);
}
public void Percentage()
{
per = tot/3;
Console.WriteLine("percentage is : \t" + per);
}
}
class Program
{
static void Main(string[] args)
{
Console.WriteLine("===========Employee setails are :- =============================");
Employee e=new Employee(101,"anil kumar",20000.0);
e.Totsal();
Console.WriteLine("===========Student setails are :- =============================");
Student s = new Student(102, "sunil kumar",60,70,80);
s.Tot();
s.Percentage();
Console.Read();
}
}
}
Friends You Like My Post Please Share To Your Friends.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook

Related Posts:

  • Logical Programing Questions in Control Statements Logical Programing Questions Using Loops Loops 1.Find the Factorial of a given Number? 2.Write a program check Whether Given Number is Even or Od… Read More
  • Asp.NET Logical Programs In the following program there are three radio buttons and one submit button whenever we click on one radio button and click on submit it will … Read More
  • Brief Explanation About Microsoft SQL Server Here we are placing Microsoft SQL Server brief description and how to work with sql server also give a best explanation about why it came's.For who … Read More
  • Arrays brief description in C# Arrays are the best and important topic for every programming developer take the help of arrays.Arrays are used to store multiple values at a time a… Read More
  • Best Description for Inheritance in c#.net and Java OOPS Principles are abstraction,inheritance,polymorphism these are basic points for oops.Inheritance is the most important and extraordinary topic.W… Read More
Newer Post Older Post Home

0 comments:

Post a Comment

Popular Posts

  • Love Failure Quotes and Sad valentines day Quotes
    We Love Someone is a easy process sometime takes long time to love someone love others within short period but anyway always love dependin...
  • Brief Description about Multicast Delegate
    Multicast delegate is an extension of normal delegate. It helps you to point more than one method at a single moment of time. Multicast ...
  • Top 10 valentine's day Quotes and Greetings wishes
    All Lovers have Anxiety in Valentines day because it is a festival to all lovers in these they enjoy a lot and celebrate the Valentine...
  • Missing My Friend Quotes : Friendship Day Quotes 2017
    Friends today my article about missing friends and moments with them. Here you are seen the best friendship quotes and some  feelings when...
  • Brief description about Delegates
    Introduction about delegates and why delegates are came the main purpose of delegates how to useful and what are the advantages and disadv...
  • Wonderful sayings about Life.
    I Believe Follow  Things(Life Quotes) I Believe I believe: ********** Believe in Life ********** That we don't have to chan...
  • Top 10 Words Of Encouragement and encouraging quotes
    Friends when you are depression mood everyone have some encouragement words that gives boost strength for You i feel these quotes helpful ...
  • Na Tanu Samjhawan Ki Song lyrics
    Na Tanu Samjhawan Ki Song Lyrics With English Translation Movie : Humpty Sharma ki Dulhaniya Song : Samjhawan Song Singer : Arijit ...
  • swami vivekananda best motivational Quotes
    Some Peoples are always have a negative thinking & bad mood their heart always filled with sadness & they are in depression mood.e...
  • Best Good Afternoon wishes greetings and quotes
    Top Most Good Afternoon Wishes Good Afternoon wishes are gives a relaxation in afternoon time.This wishing can be done between 12 to 3 p...

Categories

  • Entertainment (67)
  • TechnicalQuestions (58)
  • Quotes (11)
  • C#.Net (8)
  • Java (8)
  • ValentinesDay (4)
  • SEO (3)
  • Home
  • About Us
  • Disclaimer
  • Privacy Policy
  • Sitemap

Copyright © 2015-2017 Good Friends 5.All Rights Reserved• And Our Sitemap • All Logos and Trademark Belongs To Their Respective Owners•