Lass THONG TIN
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bai28
{
class THONGTIN
{
protected string hoten, bangcap,chucvu;
protected int namsinh,ngaycong;
protected float bacluong;
public virtual void Nhap()
{
Console.Write("Nhap ho ten: ");
hoten=Console.ReadLine();
Console.Write("Nhap bang cap: ");
bangcap=Console.ReadLine();
Console.Write("Nhap nam sinh: ");
namsinh = int.Parse(Console.ReadLine());
Console.Write("Nhap chuc vu: ");
chucvu=Console.ReadLine();
Console.Write("Nhap ngay cong: ");
ngaycong=int.Parse(Console.ReadLine());
Console.Write("Nhap bac luong: ");
bacluong=float.Parse(Console.ReadLine());
}
public virtual void xuat()
{
Console.WriteLine("Ho ten: "+hoten);
Console.WriteLine("Nam sinh: "+namsinh);
Console.WriteLine("Bang cap "+bangcap);
Console.WriteLine("Chuc vu: "+chucvu);
Console.WriteLine("Ngay cong "+ngaycong);
Console.WriteLine("Bac luong" +bacluong);
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bai28
{
class THONGTIN
{
protected string hoten, bangcap,chucvu;
protected int namsinh,ngaycong;
protected float bacluong;
public virtual void Nhap()
{
Console.Write("Nhap ho ten: ");
hoten=Console.ReadLine();
Console.Write("Nhap bang cap: ");
bangcap=Console.ReadLine();
Console.Write("Nhap nam sinh: ");
namsinh = int.Parse(Console.ReadLine());
Console.Write("Nhap chuc vu: ");
chucvu=Console.ReadLine();
Console.Write("Nhap ngay cong: ");
ngaycong=int.Parse(Console.ReadLine());
Console.Write("Nhap bac luong: ");
bacluong=float.Parse(Console.ReadLine());
}
public virtual void xuat()
{
Console.WriteLine("Ho ten: "+hoten);
Console.WriteLine("Nam sinh: "+namsinh);
Console.WriteLine("Bang cap "+bangcap);
Console.WriteLine("Chuc vu: "+chucvu);
Console.WriteLine("Ngay cong "+ngaycong);
Console.WriteLine("Bac luong" +bacluong);
}
}
}
class Cnhakhoahoc
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bai28
{
class Cnhakhoahoc:THONGTIN
{
float luong;
int sobaidang;
public override void Nhap()
{
base.Nhap();
Console.Write("so bai dang da cong bo: ");
sobaidang=int.Parse(Console.ReadLine());
}
public override void xuat()
{
base.xuat();
Console.WriteLine(sobaidang);
luong = ngaycong * bacluong;
Console.WriteLine("Luong :" + luong);
}
public void NhapDS(Cnhakhoahoc []a,int n)
{
for(int i=0;i<n;i++)
{
Console.WriteLine("Nhap thong tin nha khoa hoc thu {0}",i+1);
a[i]=new Cnhakhoahoc();
a[i].Nhap();
}
}
public void XuatDS(Cnhakhoahoc[] a, int n)
{
float tong = 0;
for (int i = 0; i < n; i++)
{
Console.WriteLine("Thong tin nha khoa hoc thu {0}", i + 1);
a[i].xuat();
tong += a[i].luong;
}
Console.WriteLine("Tong luong chi tra" + tong);
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bai28
{
class Cnhakhoahoc:THONGTIN
{
float luong;
int sobaidang;
public override void Nhap()
{
base.Nhap();
Console.Write("so bai dang da cong bo: ");
sobaidang=int.Parse(Console.ReadLine());
}
public override void xuat()
{
base.xuat();
Console.WriteLine(sobaidang);
luong = ngaycong * bacluong;
Console.WriteLine("Luong :" + luong);
}
public void NhapDS(Cnhakhoahoc []a,int n)
{
for(int i=0;i<n;i++)
{
Console.WriteLine("Nhap thong tin nha khoa hoc thu {0}",i+1);
a[i]=new Cnhakhoahoc();
a[i].Nhap();
}
}
public void XuatDS(Cnhakhoahoc[] a, int n)
{
float tong = 0;
for (int i = 0; i < n; i++)
{
Console.WriteLine("Thong tin nha khoa hoc thu {0}", i + 1);
a[i].xuat();
tong += a[i].luong;
}
Console.WriteLine("Tong luong chi tra" + tong);
}
}
}
class Cnhaquanli
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bai28
{
class Cnhaquanli:THONGTIN
{
float luong;
public new void Nhap()
{
base.Nhap();
}
public new void xuat()
{
base.xuat();
luong = ngaycong * bacluong;
Console.WriteLine("Luong :" + luong);
}
public void NhapDS(Cnhaquanli[] a, int n)
{
for (int i = 0; i < n; i++)
{
Console.WriteLine("Nhap thong tin nha quan li thu {0}", i + 1);
a[i] = new Cnhaquanli();
a[i].Nhap();
}
}
public void XuatDS(Cnhaquanli[] a, int n)
{
float tong = 0;
for (int i = 0; i < n; i++)
{
Console.WriteLine("Thong tin nha nha quan li thu {0}", i + 1);
a[i].xuat();
tong += a[i].luong;
}
Console.WriteLine("Tong luong chi tra" + tong);
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bai28
{
class Cnhaquanli:THONGTIN
{
float luong;
public new void Nhap()
{
base.Nhap();
}
public new void xuat()
{
base.xuat();
luong = ngaycong * bacluong;
Console.WriteLine("Luong :" + luong);
}
public void NhapDS(Cnhaquanli[] a, int n)
{
for (int i = 0; i < n; i++)
{
Console.WriteLine("Nhap thong tin nha quan li thu {0}", i + 1);
a[i] = new Cnhaquanli();
a[i].Nhap();
}
}
public void XuatDS(Cnhaquanli[] a, int n)
{
float tong = 0;
for (int i = 0; i < n; i++)
{
Console.WriteLine("Thong tin nha nha quan li thu {0}", i + 1);
a[i].xuat();
tong += a[i].luong;
}
Console.WriteLine("Tong luong chi tra" + tong);
}
}
}
class Cphongthinghiem
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bai28
{
class Cphongthinghiem:THONGTIN
{
int luongtrongthang;
public override void Nhap()
{
//base.Nhap();
Console.Write("Nhap ho ten: ");
hoten = Console.ReadLine();
Console.Write("Nhap bang cap: ");
bangcap = Console.ReadLine();
Console.Write("Nhap nam sinh: ");
namsinh = int.Parse(Console.ReadLine());
Console.Write("Luong trong thang ");
luongtrongthang = int.Parse(Console.ReadLine());
}
public override void xuat()
{
//base.xuat();
Console.WriteLine("Ho ten "+hoten);
Console.WriteLine("Nam sinh "+namsinh);
Console.WriteLine("Bang cap "+bangcap);
Console.WriteLine("Luong trong thang "+ luongtrongthang);
}
public void NhapDS(Cphongthinghiem[] a, int n)
{
for (int i = 0; i < n; i++)
{
Console.WriteLine("Nhap thong tin nhan vien phong thi nghiem thu {0}", i + 1);
a[i] = new Cphongthinghiem();
a[i].Nhap();
}
}
public void XuatDS( Cphongthinghiem[] a, int n)
{
float tong = 0;
for (int i = 0; i < n; i++)
{
Console.WriteLine("Thong tin nhan vien phong thi nghiem thu {0}", i + 1);
a[i].xuat();
tong += a[i].luongtrongthang;
}
Console.WriteLine("Tong luong chi tra" + tong);
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bai28
{
class Cphongthinghiem:THONGTIN
{
int luongtrongthang;
public override void Nhap()
{
//base.Nhap();
Console.Write("Nhap ho ten: ");
hoten = Console.ReadLine();
Console.Write("Nhap bang cap: ");
bangcap = Console.ReadLine();
Console.Write("Nhap nam sinh: ");
namsinh = int.Parse(Console.ReadLine());
Console.Write("Luong trong thang ");
luongtrongthang = int.Parse(Console.ReadLine());
}
public override void xuat()
{
//base.xuat();
Console.WriteLine("Ho ten "+hoten);
Console.WriteLine("Nam sinh "+namsinh);
Console.WriteLine("Bang cap "+bangcap);
Console.WriteLine("Luong trong thang "+ luongtrongthang);
}
public void NhapDS(Cphongthinghiem[] a, int n)
{
for (int i = 0; i < n; i++)
{
Console.WriteLine("Nhap thong tin nhan vien phong thi nghiem thu {0}", i + 1);
a[i] = new Cphongthinghiem();
a[i].Nhap();
}
}
public void XuatDS( Cphongthinghiem[] a, int n)
{
float tong = 0;
for (int i = 0; i < n; i++)
{
Console.WriteLine("Thong tin nhan vien phong thi nghiem thu {0}", i + 1);
a[i].xuat();
tong += a[i].luongtrongthang;
}
Console.WriteLine("Tong luong chi tra" + tong);
}
}
}
class program
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bai28
{
class Program
{
static void Main(string[] args)
{
int n,m,p;
Cnhakhoahoc []a1 = new Cnhakhoahoc [100];
Cnhakhoahoc a = new Cnhakhoahoc();
Cnhaquanli[] b1 = new Cnhaquanli[100];
Cnhaquanli b = new Cnhaquanli();
Cphongthinghiem[] c1= new Cphongthinghiem[100];
Cphongthinghiem c = new Cphongthinghiem();
Console.Write("nhap so luong nha khoa hoc: ");
n = int.Parse(Console.ReadLine());
a.NhapDS(a1, n);
Console.Write("nhap so luong nha quan li: ");
m = int.Parse(Console.ReadLine());
b.NhapDS(b1,m);
Console.Write("nhap so luong nhan vien phong thi nghiem: ");
p = int.Parse(Console.ReadLine());
c.NhapDS(c1, p);
a.XuatDS(a1, n);
b.XuatDS(b1, m);
c.XuatDS(c1,p);
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bai28
{
class Program
{
static void Main(string[] args)
{
int n,m,p;
Cnhakhoahoc []a1 = new Cnhakhoahoc [100];
Cnhakhoahoc a = new Cnhakhoahoc();
Cnhaquanli[] b1 = new Cnhaquanli[100];
Cnhaquanli b = new Cnhaquanli();
Cphongthinghiem[] c1= new Cphongthinghiem[100];
Cphongthinghiem c = new Cphongthinghiem();
Console.Write("nhap so luong nha khoa hoc: ");
n = int.Parse(Console.ReadLine());
a.NhapDS(a1, n);
Console.Write("nhap so luong nha quan li: ");
m = int.Parse(Console.ReadLine());
b.NhapDS(b1,m);
Console.Write("nhap so luong nhan vien phong thi nghiem: ");
p = int.Parse(Console.ReadLine());
c.NhapDS(c1, p);
a.XuatDS(a1, n);
b.XuatDS(b1, m);
c.XuatDS(c1,p);
}
}
}
Tks BÁc :d
ReplyDelete