首页 › 题库 › Python编程考级 › 1 类与对象

Python编程六级 题库

共 394 道题 ,第 19 / 20 页 · 按题型筛选,点「查看答案」核对解析
章节 1 类与对象 清除
361 判断题 偏易 Python编程考级 ·Python编程六级 · 1.1 类与实例

在 Python 中,使用open()函数打开文件进行读取时,文件路径必须是绝对路径。( )

A
对
B
错
答案与解析
正确答案:错

在 Python 中,使用open()函数打开文件进行读取时,文件路径既可以是绝对路径,也可以是相对路径。相对路径是相对于当前工作目录来确定文件位置,使用相对路径可以使代码在不同环境下更灵活地运行。

题目详情
362 判断题 偏易 Python编程考级 ·Python编程六级 · 1.1 类与实例

一个学生成绩管理系统需要从SQLite数据库中查询学生信息。在执行查询操作时,fetchmany(size=2)会返回结果中的前两行。( )

A
对
B
错
答案与解析
正确答案:错

fetchmany(size=2)返回当前游标位置开始的2行,而非“前两行”。

题目详情
363 判断题 偏易 Python编程考级 ·Python编程六级 · 1.2 属性与方法

Python的tkinter库中,使用grid()方法管理布局,需要将Label标签放入第一行第一列的写法是:grid(row=1,column=1) 。( )

A
对
B
错
答案与解析
正确答案:错

grid的方法中column为指定组件插入的列(0表示第一列),row为指定组件插入的行(0表示第一行)。

题目详情
364 判断题 偏易 Python编程考级 ·Python编程六级 · 1.1 类与实例

JSON数据是纯文本格式,因此它可以很容易地被机器解析和生成。( )

A
对
B
错
答案与解析
正确答案:对

JSON(JavaScript Object Notation)数据是一种纯文本格式。它使用易于阅读和编写的键值对结构来表示数据。这种格式使得JSON非常适合用于数据交换和存储。

题目详情
365 判断题 偏易 Python编程考级 ·Python编程六级 · 1.1 类与实例

绘制图形如图所示,画线处的的语句填写是否正确 ?( )

import matplotlib.pyplot as plt  
x = [1, 2, 3, 4, 5]  
y = [1, 4, 9, 16, 25]  
plt.plot(x, y)  
plt.xlabel('y=x**2')
plt.show()
A
对
B
错
答案与解析
正确答案:对

Matplotlib中设置x轴的标签为plt.xlabel()。

题目详情
366 判断题 偏易 Python编程考级 ·Python编程六级 · 1.1 类与实例

使用matplotlib的 plt.text() 函数可以在图表的任意位置添加文本注释,但是无法控制文本的对齐方式。( )

A
对
B
错
答案与解析
正确答案:错

plt.text() 函数不仅允许你指定文本的具体位置,还可以通过参数如 horizontalalignment, verticalalignment 等来控制文本的对齐方式。

题目详情
367 判断题 偏易 Python编程考级 ·Python编程六级 · 1.2 属性与方法

在Python中,子类可以覆盖父类中的方法,但不能覆盖父类中的属性。( )

A
对
B
错
答案与解析
正确答案:错

子类可以通过定义具有相同名称的属性和方法来覆盖父类中的属性和方法。这是面向对象编程中多态的一个重要特性。

题目详情
368 判断题 偏易 Python编程考级 ·Python编程六级 · 1.1 类与实例

readline()函数读取文本文件内容,返回的是一个列表,其中每一行的数据为一个元素。( )

A
对
B
错
答案与解析
正确答案:错

readlines()函数读取文本文件内容,返回的是一个列表,其中每一行的数据为一个元素。

题目详情
369 判断题 偏易 Python编程考级 ·Python编程六级 · 1.2 属性与方法

Python的SQLite库中的execute()方法只能执行SQL查询,不能执行SQL命令。( )

A
对
B
错
答案与解析
正确答案:错

Python的SQLite库中的execute()方法确实可以执行SQL查询和SQL命令。

题目详情
370 判断题 偏易 Python编程考级 ·Python编程六级 · 1.2 属性与方法

__init__是一个类的构造器,Python中每个类只能有一个__init__方法。( )

A
对
B
错
答案与解析
正确答案:对

__init__方法在Python中被视为类的构造器,用于初始化新创建的对象。虽然一个类可以定义多个初始化方法,但__init__是特殊方法,用于对象的初始化,且一个类中只能定义一个__init__方法。

题目详情
371 简答题 偏难 Python编程考级 ·Python编程六级 · 1.1 类与实例

小明编写一个类实现设置马的品种、年龄、性别及速度,输出相应的语句,请补全代码。
如下代码输出结果为“一匹阿拉伯12岁的公马,在草原上奔跑的速度为50km/h”。
class         ①        :
    def __init__(self, category, gender, age):
        self.category = category
               ②        
        self.age = age
        self.speed = 0
    def get_descriptive(self):
        self.info = "一匹" + self.category +        ③        + "岁的" +self.gender + "马"
    def write_speed(self, new_speed):
        self.speed = new_speed
        addr = "在草原上奔跑的速度为"
        print(        ④        + "," + addr + str(self.speed) + "km/h。")
horse = Horse("阿拉伯","公",12)
horse.get_descriptive()
horse.write_speed(50)

答案与解析
参考答案
# 样例代码
class Horse :
    def __init__(self, category, gender, age):
        self.category = category
        self.gender = gender
        self.age = age
        self.speed = 0
    def get_descriptive(self):
        self.info = "一匹" + self.category + str(self.age) + "岁的" +self.gender + "马"
    def write_speed(self, new_speed):
        self.speed = new_speed
        addr = "在草原上奔跑的速度为"
        print(self.info + "," + addr + str(self.speed) + "km/h。")
horse = Horse("阿拉伯","公",12)
horse.get_descriptive()
horse.write_speed(5
题目详情
372 简答题 偏难 Python编程考级 ·Python编程六级 · 1.1 类与实例

有十位选手参加某项比赛,共有10位评委参与评分。每位选手得分已保存在“score1.txt”文件中,如图所示。第一行表示1号选手的所有得分,第二行表示2号选手的所有得分,依次类推。最终得分的计分规则为去掉一个最高分,去掉一个最低分,求余下分数的平均分。请找出最终得分最高的选手。“score1.txt”文件的内容如图所示。

程序代码如下:
with open("/data/        ①        ", encoding="UTF-8") as f:
    data = f.readline().strip()
    i = 0
    m = 0
    while data:
               ②        
        score = list(map(float, data.split()))
        result = (sum(score) - min(score) - max(score)) / (len(score) - 2)
        if         ③        :
            m = result
            pos = i
        data =        ④        .strip()
print("成绩最佳的选手是:" +        ⑤        + "号,得分:" + str(m) + "分")
请在画线处填入正确的代码。

答案与解析
参考答案
# 样例代码
with open("/data/score1.txt", encoding="UTF-8") as f:
    data = f.readline().strip()
    i = 0
    m = 0
    while data:
        i+=1
        score = list(map(float, data.split()))
        result = (sum(score) - min(score) - max(score)) / (len(score) - 2)
        if result>m :
            m = result
            pos = i
    data =f.readline().strip()
print("成绩最佳的选手是:" +str(pos)+ "号,得分:" + str(m) + "分"
题目详情
373 简答题 偏难 Python编程考级 ·Python编程六级 · 1.1 类与实例

使用Python的sqlite3库完成以下问题。
1.在data.db文件内创建一个学生成绩表student(不考虑data.db的路径)
2.student中包含
学号(num),类型INTEGER PRIMARY KEY
姓名(name),类型TEXT
成绩(grade),类型int
名次(rank),类型int
3.增加一条记录(1,"lilei",100,50)

程序如下,请补全代码。
import sqlite3
conn=        ①        
cur =        ②        
cur.execute("CREATE TABLE IF NOT EXISTS student(num INTEGER PRIMARY KEY ,name text,grade int,rank int)")
cur.execute("insert into student(        ③        ) values(        ④        )")
        ⑤        
cur.close()
conn.close()

答案与解析
参考答案
# 样例代码
import sqlite3
conn=sqlite3.connect('data.db')
cur = conn.cursor()
cur.execute("CREATE TABLE IF NOT EXISTS student(num INTEGER PRIMARY KEY ,name text,grade int,rank int)")
cur.execute("insert into student(num,name,grade,rank) values(1,'lilei',100,50)")
conn.commit()
cur.close()
conn.close()
题目详情
374 简答题 偏难 Python编程考级 ·Python编程六级 · 1.1 类与实例

当前,我国正在开展新型冠状病毒疫苗接种,自今年 2 月份以来,许多学校的教职员工积极利用空余时间,到当地卫健部门指定的接种点去接种,为了帮助政教员小叶排摸全校教职员工接种情况,根据每天汇总的接种登记表(包含全校教职员工的姓名、组别、年龄、是否接种等信息,已转换为csv格式,见图1”),小徐利用 Python 编写了一个统计程序,方便向校领导汇报各教研组接种情况及全校接种比例等。该程序运行的部分界面如图2所示,请在程序划线处填入合适的代码。

图1

图2

import csv

f = open("/data/vi.csv", "r")

Vac_T = {"语文组": 0, "数学组": 0, "英语组": 0, "物理组": 0, "化学组": 0, "生物组": 0, "政治组":0,"历史组":0,"地理组":0,"技术组":0,"体音美组":0,"后勤组":0,"政教组": 0}

Vac_F = {"语文组": 0, "数学组": 0, "英语组": 0, "物理组": 0, "化学组": 0, "生物组": 0, "政治组":0,"历史组":0,"地理组":0,"技术组":0,"体音美组":0,"后勤组":0,"政教组": 0}

list1 =[] 

zrs = 0

zu_max = 0

line = f.readline()

while line:

    line = line.strip('\n')

    data = line.split(",")

    list1.append(data)

              ①           

print(list1[:5])

print("--------------------------------------------")

f.close()  

num = len(list1)

for i in range(num):

    line_list = list1[i]  

    if            ②           :

        Vac_T[line_list[1]] += 1

    else:

        Vac_F[line_list[1]] += 1

for i in Vac_T:

    zu_per = Vac_T[i]/(Vac_T[i]+Vac_F[i])  

    if zu_per > zu_max:

        zu_max = zu_per

        zu = i

               ③          

tot_per = int(zrs/num*10000+0.5)/100

print("各组接种人数:", Vac_T)

print("各组未接种人数:", Vac_F)

print("全校接种比例:", tot_per)

print("接种疫苗比例最高的组:", zu)

答案与解析
参考答案

参考程序:

import csv
f = open("/data/vi.csv", "r")
Vac_T = {"语文组": 0, "数学组": 0, "英语组": 0, "物理组": 0, "化学组": 0, "生物组": 0, "政治组":0,"历史组":0,"地理组":0,"技术组":0,"体音美组":0,"后勤组":0,"政教组": 0}
Vac_F = {"语文组": 0, "数学组": 0, "英语组": 0, "物理组": 0, "化学组": 0, "生物组": 0, "政治组":0,"历史组":0,"地理组":0,"技术组":0,"体音美组":0,"后勤组":0,"政教组": 0}
list1 =[] 
zrs = 0
zu_max = 0
line = f.readline()
while line:
    line = line.strip('\n')
    data = line.split(",")
    list1.append(data)
    line = f.readline()
print(list1[:5])
print("--------------------------------------------")
f.close()  
num = len(list1)
for i in range(num):
    line_list = list1[i]  
    if line_list[3] == "是":
        Vac_T[line_list[1]] += 1
    else:
        Vac_F[line_list[1]] += 1
for i in Vac_T:
    zu_per = Vac_T[i]/(Vac_T[i]+Vac_F[i])  
    if zu_per > zu_max:
        zu_max = zu_per
        zu = i
    zrs += Vac_T[i]
tot_per = int(zrs/num*10000+0.5)/100
print("各组接种人数:", Vac_T)
print("各组未接种人数:", Vac_F)
print("全校接种比例:", tot_per)
print("接种疫苗比例最高的组:", zu)

评分标准:

(1)line = f.readline() ; (3分)

(2)line_list[3] == "是"  ;  (4分)

(3)zrs += Vac_T[i] 。  (3分)

题目详情
375 简答题 偏难 Python编程考级 ·Python编程六级 · 1.1 类与实例

编程定义一个类,实现求长方体体积,并输出当长方体的长度、宽度和高度分别为10、20和30时的体积,请保留小数点后两位数字。

请补全代码:

class Box():

    def __init__(           ①           ):

                   ②           =length1

                   ③           =width1

                   ④           =height1

    def volume(self):

        return            ⑤           

my_box=Box(10,20,30)

print("长方体体积是%.2f"%my_box.volume())

答案与解析
参考答案

参考程序:

class Box():
    def __init__(self,length1,width1,height1):
        self.length=length1
        self.width=width1
        self.height=height1
    def volume(self):
        return self.length*self.width*self.height
my_box=Box(10,20,30)
print("长方体体积是%.2f"%my_box.volume())

评分标准:

(1)self,length1,width1,height1;(2分)

(2)self.length;(2分)

(3)self.width; (2分)

(4)self.height;(2分)

(5)self.length*self.width*self.height。(2分)

题目详情
376 简答题 偏难 Python编程考级 ·Python编程六级 · 1.2 属性与方法

打开一个由小写英文组成的文本文件'old.txt',将该文件中的每一个字母加密后写入到一个新文件'new.txt',加密的方法是:a变成b,b变成c……,z变成a,其它字符不变化(不考虑文件路径)


file=open("old.txt","r")

line=file.         ①        


list=[]

while line:

    for i in range(        ②        ):

        if line[i].islower():

           jm=        ③        

           list.append(chr(jm))

        else:

            list.append(line[i])

    line=file.readline()

s=''.join(list)

file=open("new.txt","w+")

        ④        

file.close()

答案与解析
参考答案
#参考程序:
file=open("old.txt","r")

line=file.readline()
list=[]
while line:
    for i in range(len(line)):
        if line[i].islower():
           jm=(ord(line[i])-97+1)%26+97
           list.append(chr(jm))
        else:
            list.append(line[i])
    line=file.readline()
s=''.join(list)
file=open("new.txt","w+")
file.write(s)
file.close()


评分标准:

(1)readline();(2分) 

(2)len(line);(3分) 

(3)(ord(line[i])-97+1)%26+97;(3分) 

(4)file.write(s)。(2分)

题目详情
377 简答题 偏难 Python编程考级 ·Python编程六级 · 1.3 创建类与子类

创建一个学生类,存储学生的姓名、语文成绩、英语成绩和数学成绩,根据成绩计算相应的等级,成绩≥90为'A',成绩∈[80,90]为'B',成绩∈[60,80]为'C',成绩≤60为'D'。创建一个班级类,该类有班级名称和学生2个属性,显示班级所有学生的姓名及相应的等级。程序运行效果如下图所示。

程序代码如下:

class stu:
    def __init__(self,name,chinese,english,math):
        self.name=name
        self.c= chinese
        self.e= english
                ①        
        lis=[self.c,self.e,self.m]
        self.lis=lis
    def level(self):
        for i in range(3):
            if         ②        :
                self.lis[i]='A'
            elif  self.lis[i]>80:
                self.lis[i]='B'
            elif  self.lis[i]>60:
                self.lis[i]='C'
            else:
                self.lis[i]='D'
        return self.lis
    def show(self):
        print(f'姓名:{self.name},等级:{        ③        }')
class lesson:
    def __init__(self, name, students=[]):
        self.students = students
        self.class_name = name
    def show_student(self):
        for stu in self.students:
                    ④        
students = [ stu('jack',90,80,90),
             stu('candy',95,88,69),
             stu('cindy',66,76,39),
             stu('frank',61,87,44),
             stu('tony',20,65,49)]
class1 = lesson("高一(1)班",students)
        ⑤


请在划线处填入正确的代码。

答案与解析
参考答案
#参考程序:
class stu:
    def __init__(self,name,chinese,english,math):  # 定义类,类名为Student
        self.name=name              # 姓名属性
        self.c= chinese             # 语文成绩属性
        self.e= english             # 英语成绩属性
        self.m = math               # 数学成绩属性
        lis=[self.c,self.e,self.m]  # 成绩存入列表
        self.lis=lis
    def level(self):
        for i in range(3):   
            if self.lis[i] >=90:    # 等级判断
                self.lis[i]='A'
            elif  self.lis[i]>80:
                self.lis[i]='B'
            elif  self.lis[i]>60:
                self.lis[i]='C'
            else:
                self.lis[i]='D'
        return self.lis
    def show(self):         # 定义show方法,用于显示信息
        print(f'姓名:{self.name},等级:{self.level()}')
     
class lesson:              # 定义 lesson类
    def __init__(self, name, students=[]):     # 定义2个属性
        self.students = students               # 定义学生属性
        self.class_name = name                 # 定义姓名属性
    def show_student(self):   # 定义show_student方法,用于显示学生列表
        for stu in self.students:              # 遍历学生列表
            stu.show()                         # 显示学生信息
students = [ stu('jack',90,80,90),
                   stu('candy',95,88,69),
                   stu('cindy',66,76,39),
                   stu('frank',61,87,44),
                   stu('tony',20,65,49)]
class1 = lesson("高一(1)班",students)
class1.show_student()


评分标准:

(1)self.m = math;(2分) 

(2)self.lis[i] >=90;(2分) 

(3)self.level();(2分)

(4)stu.show();(2分) 

(5)class1.show_student()。(2分) 

题目详情
378 简答题 偏难 Python编程考级 ·Python编程六级 · 1.1 类与实例

马和骆驼都是哺乳动物,它们都有四只脚,体型也差不多大,我们将在这里为它们编写属于它们各自的类,输出相关语句。

例如:一匹阿拉伯12岁的公马,在草原上奔跑的速度为50km/h。

一匹双峰驼20岁的母骆驼,在沙漠上奔跑的速度为40kmh。

class Horse():
    def __init__(self, category, gender, age):
        self.category = category
        self.gender = gender
        self.age = age
        self.speed = 0
    def get_descriptive(self):
        self.info = "一匹" + self.category + str(self.age) + "岁的" + self.gender + "马"
    def write_speed(self, new_speed):
        self.speed= new_speed
        addr = "在草原上奔跑的速度为"
        print(self.info + "," + addr + str(self.speed) + "km/h。")
class Came1(        ①        ):
    def __init__(self, category, gender, age):
        super().__init__(category, gender, age)
    def write_speed(self,new_speed):
                   ②        
        addr = "在沙漠上奔跑的速度为"
        print(        ③        ("马","骆驼") + "," + addr +        ④        + "km/h。")

horse = Horse("阿拉伯","公",12)
horse.get_descriptive()
horse.write_speed(50)
came1 = Came1("双峰驼","母",20)
came1.get_descriptive()
came1. write_speed(40)
答案与解析
参考答案
class Horse():
    def __init__(self, category, gender, age):
        self.category = category
        self.gender = gender
        self.age = age
        self.speed = 0
    def get_descriptive(self):
        self.info = "一匹" + self.category + str(self.age) + "岁的" + self.gender + "马"
    def write_speed(self, new_speed):
        self.speed= new_speed
        addr = "在草原上奔跑的速度为"
        print(self.info + "," + addr + str(self.speed) + "km/h。")
class Came1(Horse):
    def __init__(self, category, gender, age):
        super().__init__(category, gender, age)
    def write_speed(self,new_speed):
        self.speed= new_speed
        addr = "在沙漠上奔跑的速度为"
        print(self.info.replace("马","骆驼") + "," + addr + str(self.speed) + "km/h。")

horse = Horse("阿拉伯","公",12)
horse.get_descriptive()
horse.write_speed(50)
came1 = Came1("双峰驼","母",20)
came1.get_descriptive()
came1. write_speed(40)

评分标准:

(1)Horse;(2分)

(2)self.speed= new_speed;(2分)

(3)self.info.replace;(4分)

(4)str(self.speed)。(2分)

题目详情
379 简答题 偏难 Python编程考级 ·Python编程六级 · 1.2 属性与方法

编写一个类`Circle`,包含两个属性`radius`和`color`,以及四个方法`get_area()`、`get_circumference()`、`get_diameter()`和`print_info()`,分别用于计算圆面积、圆周长、圆直径,并打印出圆的半径和颜色。

代码如下,请补全代码。

class Circle:

    def __init__(self, radius, color):

                ①        

        self.color = color

    

    def get_area(self):                  #圆面积

        return         ②        

    

    def get_circumference(self):     #圆周长

        return         ③        

    

    def get_diameter(self):

        return 2 * self.radius

    

    def print_info(self):                      

        print("Radius:", self.radius)

        print("Color:", self.color)


circle = Circle(5, "red")

         ④               #输出圆的半径和颜色

print("Area:", circle.get_area())

print("Circumference:", circle.get_circumference())

print("Diameter:", circle.get_diameter())

答案与解析
参考答案
class Circle:
    def __init__(self, radius, color):
        self.radius = radius
        self.color = color
    
    def get_area(self):                           #圆面积
        return 3.14 * self.radius ** 2
    
    def get_circumference(self):              #圆周长
        return 2 * 3.14 * self.radius
    
    def get_diameter(self):
        return 2 * self.radius
    
    def print_info(self):                      
        print("Radius:", self.radius)
        print("Color:", self.color)

circle = Circle(5, "red")
circle.print_info()                     #输出圆的半径和颜色
print("Area:", circle.get_area())
print("Circumference:", circle.get_circumference())
print("Diameter:", circle.get_diameter())

评分标准:

(1)self.radius = radius或等效答案;(2分)

(2)3.14 * self.radius ** 2或等效答案;(3分)

(3)2 * 3.14 * self.radius或等效答案;(2分)

(4)circle.print_info()或等效答案。(3分)

题目详情
380 简答题 偏难 Python编程考级 ·Python编程六级 · 1.2 属性与方法

工资管理

编写简单的工资管理程序,系统中包含工人(worker)和经理(manage),所有员工都有员工号、姓名、基本工资等属性。

工人:工人具有工作小时数和时薪的属性,工资计算方法为基本工资 + 工作小时数 * 时薪;

经理: 具有固定的月薪,计算方法为固定月薪。

根据以上的要求设计类,显示人员的信息和工资情况,运行结果如下:

工号:001,姓名:King,本月工资:10000

King的月薪是:10000

工号:002,姓名:Lily,本月工资:20000

Lily每天的工作时长:10小时

Lily的月薪是: 20000

class Person():

    def __init__(self,id,name,salary):

        self.id = id

        self.name = name

                ①        

    def __str__(self):#查看对象,触发执行print语句

        msg = '工号:{},姓名:{},本月工资:{}'.format(self.id,self.name,self.salary)

        return msg

class Worker(Person):

    def __init__(self,id,name,salary,hours,per_hour):

        super().__init__(id,name,salary)

        self.hours = hours

        self.per_hour = per_hour

    def getSalary(self):

        money = self.hours * self.per_hour

                ②        

        return         ③        

class Manage(Person):

    def __init__(self,id,name,salary,time):

        super().__init__(id,name,salary)

        self.time = time

        

    def getSalary(self):

        return self.salary,self.time

worker = Worker('001','King',2000,160,50)

sal = worker.getSalary()

print(worker)

print('King的月薪是:{}'.format(sal))

manage = Manage('002','Lily',20000,10)

        ④        ,  work_time   = manage.getSalary()

print(manage)

print('{}每天的工作时长:{}小时'.format('Lily',        ⑤        ))

print('Lily的月薪是:',sal)

答案与解析
参考答案
#参考程序
class Person():
    def __init__(self, id, name, salary):
        self.id = id  # 工号
        self.name = name  # 姓名
        self.salary = salary  # 本月工资
 
    def __str__(self):
        msg = '工号:{},姓名:{},本月工资:{}'.format(self.id, self.name, self.salary)
        return msg
 
class Worker(Person):
    def __init__(self, id, name, salary, hours, per_hour):
        super().__init__(id, name, salary)  # 调用父类的构造方法
        self.hours = hours  # 工作小时数
        self.per_hour = per_hour  # 每小时工资
 
    def getSalary(self):
        money = self.hours * self.per_hour  # 计算工资
        self.salary += money  # 更新工资
        return self.salary
 
class Manage(Person):
    def __init__(self, id, name, salary, time):
        super().__init__(id, name, salary)  # 调用父类的构造方法
        self.time = time  # 工作时长
 
    def getSalary(self):
        return self.salary, self.time
 
worker = Worker('001', 'King', 2000, 160, 50)  # 创建Worker对象
sal = worker.getSalary()  # 计算工资
print(worker)  # 打印Worker对象的信息
print('King的月薪是:{}'.format(sal))
 
manage = Manage('002', 'Lily', 20000, 10)  # 创建Manage对象
sal, work_time = manage.getSalary()  # 获取工资和工作时长
print(manage)  # 打印Manage对象的信息
print('{}每天的工作时长:{}小时'.format('Lily', work_time))
print('Lily的月薪是:', sal)


评分标准:

(1)self.salary = salary;(2分)

(2)self.salary += money;(2分)

(3)self.salary;(2分) 

(4)sal;(2分)

(5)work_time。(2分)

题目详情