[谁有C语言课程程序设计实验报告??]实 验 报 告 一 课 程 C语言程序设计 实验项目 C程序设计初步 成 绩 专业班级 学 号 指导教师 张耀文 姓 名 序 号 实验日期 一【实验目的】 1. 了解使用VC++6.0的开发环境;...+阅读
1。People.javapublic class People { //性别(sex)及出生日期(date);方法成员有:获取人的性别和出生日期及构造方法。要求构造方法可以设置性别和出生日期的初始值。 private int sex; private Date birth; public People (int sex, Date birth) { this.sex = sex; this.birth = birth; } public int getSex() { return this.sex; } public Date getBirth() { return this.birth; }}2。Student.javapublic class Student extends People{ private int sex; private Date birth; private String name; private int stuno; private double grate; private String studentNative; public Student(int sex, Date birth, String name, int stuno, double grate, String studentNative) { super(sex, birth); this.name = name; this.stuno = stuno; this.grate = grate; this.studentNative = studentNative; } public Date getBirth() { return birth; } public double getGrate() { return grate; } public String getName() { return name; } public int getSex() { return sex; } public String getStudentNative() { return studentNative; } public int getStuno() { return stuno; }}3。测试类自己编写就好了,创建一个People和Student的对象,然后设置值,取值就可以了。五。1.构造方法没有返回值,方法名和类名一样.2.继承是指子类可以拥有父类的方法和属性;多态是指父类的引用可以指向子类对象的实例3.重写4.重载
延伸阅读:
java小程序设计设计一个窗口程序import java.awt.*; import java.awt.event.*; import javax.swing.*; public class FrameTest { private JFrame jf; private JButton yellow,blue,green; private JPanel...
汇编语言程序设计1、用减奇数法开平方。(算法:N个自然数中的奇数之和等于N的平方。) 程序清单:内存datum中存要开方数 ,result中存放结果 data segment datum db 16 result db 0 data ends ss_seg...
汇编语言程序设计红旗慢慢升起code segment assume cs:code start: push cs pop ds mov ax,12h int 10h mov ax,0a000h mov es,ax mov ah,2;画旗杆 call color mov di,510 mov ax,0aeh mov cx,450 n1:stos...
VB选择循环和数组综合程序设计实验报告Private Sub Form_Click() Dim r(1 To 60) As Integer Dim e(1 To 60) As Integer Dim o(1 To 60) As Integer Dim ec As Integer, oc As Integer Dim i As Integer, j As I...
求大神帮忙做一下这个大学VB程序设计的实验报告Private Sub Command1_Click() Dim a As Integer, b As String, i As Integer, c() As String a = Len(Text1.Text) Print a ReDim c(a) As String For i = 1 To a b = Mid(...
VB程序设计实验报告1.实验名称 实验二 Visual Basic基本语句 2.实验目的 (1)掌握Visual Basic的数据类型和变量定义方法。 (2)正确使用Visual Basic的运算符和表达式。 (3)掌握Visual Basic中...
VB程序设计实验报告过程与函数求高手出手急用的我要'计算两个数的和和积 Option Explicit Dim x As Double Dim y As Double Private Sub Cmd1_Click() x = InputBox("请输入一个数:", , 0#) y = InputBox("请再输入一个数:", , 0#) Text1.T...
vb实验题程序设计dim iMax as Single,iMin as Single,iSum as Single dim i as integer private sub Command1_click() iSum=0 for i=0 to 9 isum=isum+val(text1(i).text) if iMax<val(text...
程序设计VB实验Option Explicit Function Prime(N As Integer) As Boolean Dim I As Integer If N < 2 Then Prime = False: Exit Function For I = 2 To N - 1 If N Mod I = 0 Then Prime...