9、下面的程序实现如下功能:重复提示用户输入姓名,每次用户输入姓名后,会在屏幕上打印一句问候语,并将这条问候记录添加到文件guest_book.txt中,每条记录独占一行。请在括号中补充一条语句 while true: name=input('请输入你的姓名:') book=name+',你好!欢迎光临!' print(book) My_file=open('guest_book.txt','a') () ‍ My_file.close()

9、下面的程序实现如下功能:重复提示用户输入姓名,每次用户输入姓名后,会在屏幕上打印一句问候语,并将这条问候记录添加到文件guest_book.txt中,每条记录独占一行。请在括号中补充一条语句 while true: name=input('请输入你的姓名:') book=name+',你好!欢迎光临!' print(book) My_file=open('guest_book.txt','a') () ‍ My_file.close()


参考答案和解析
14

相关考题:

在屏幕上系统提示信息为login,代表要输入( )。 A.用户名B.注册名C.用户姓名D.组号

假定在工程文件中有一个标准模块,其中定义了如下记录类型:Type BooksName As String*10TelNuin As String*20End Type要求在执行事件过程Command1_Click时,在顺序文件Person.txt中写入一条记录。将以下程序补充完整。Private Sub Command1_Clickk()DimB As Booksopen"c:\person.txt"For output As 1B.Name=InputBox("请输入姓名")B.TelNum=InputBox("请输入电话号码")write 1,______close 1End Sub

【程序说明】 程序功能是按姓名提供学生成绩的查询。【程序】SET TALK OFFUSE STDACCEPT“请输入待查学生姓名:”TO XMDO WHILE (4)IF (5)?“姓名:”+姓名,“成绩:”+STR (成绩,3,0)ENDIF(6)ENDDOSET TALK ONRETURN(4)A.BOF ()B.EOF ()C..NOT. EOF()D..NOT. BOF()

设在工程中有一个标准模块,其中定义了如下记录类型 Type Books Name As String*10 TelNum As String*20 End Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_Click时, 在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是 ______。A.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt"For Output As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Write #1,B.Name,B.TelNum Close #1 End SubB.Private Sub Command1_Click() Dim B As Books Open"c:\Person.txt" For Input As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Print #1,B.Name,B.TelNum Close #1 End SubC.Private Sub Command1_Click() Dim B As Books Open"c:\Person.txt"For Output As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Write#1,B Close #1 End SubD.Private Sub Command1_Click() Dim B As Books Open"c:\Person.txt"For Input As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print#1,Name,TelNum Close #1 End Sub

( 35 )设在工程文件中有一个标准模块,其中定义了如下记录类型:Type BooksName As String * 10TelNum As String * 20End Type在窗体上画一个名为 Command1 的命令按钮,要求当执行事件过程 Command1_Click 时,在顺序文件Person.txt 中写入一条 Books 类型的记录。下列能够完成该操作的事件过程是A ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For Output As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Write #1,B.Name,B.TelNumClose #1End SubB ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For input As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Print #1,B.Name,B.TelNumClose #1End SubC ) Private Sub Command1_Click()Dim B As BooksOpen “ Person.txt ” For Output As #`1B.Name=InputBox( “ 输入姓名 ” )B.TelNum=InputBox( “ 输入电话号码 ” )Write #1,BClose #1End SubD ) Private Sub Command1_Click()Open “ Person.txt ” For input As #`1Name=InputBox( “ 输入姓名 ” )TelNum=InputBox( “ 输入电话号码 ” )Print #1, Name, TelNumClose #1End Sub

假定在工程文件中有一个标准模块,其中定义了如下记录类型 Type Books NalTle As String*10 TelNum As String*20 End Type 要求当执行事件过程ComlBandl_Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是( )。A.Ptivate Sub Commandl_Click() DimB As Books Open"c:\Person.txt"For Output As#1B.Name=InputBox(“输入姓名”)C.Private Sub Conullandl_CHCk() DimBAs Books Open"c:\Person.txt"For Ouputut As#1 Name=hputBox(“输入姓名”) Temum=InputBox(“输入电话号码”) Whte#1,B Close#1 End Sub D.Privam Sub Commnandl_Click() DimBAsBook Open"C:\Person.tx

(35)在E盘当前目录文件夹下建立一个名为“Student.txt”的随机文件,要求用InputBox函数输入5个学生的姓名(StuName)、年级(StuGrade)和年龄(StuAge).在程序中有下列记录类型和窗体的事件过程,请选择正确的语句完成程序 Private Type student StuName As String*10 StuGrade As String*10 StuAge As String End Type Private Sub For_Click() Dim s As student Open"c:student.txt"For Random As#1 Len=Len(s) For i=1 To 1 s.StuName=InputBox("请输入姓名") s.StuGrade=InputBox("请输入年纪号") s.StuAge=InputBox("请输入年龄") Next i End Sub A.Print#1,s B.Print#1,I C.Put#1,,s D.Put#1,,i

设在工程中有一个标准模块,其中定义了如下记录类型:Type Books Name As String *10 Te1Num As String *20End Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是。A.Private Sub Command1_Click() Dim B As Books Open"c":\Person.txt"For Output As #1 B.Name=InputBox("输入姓名") B.Te1Num=InputBox("输入电话号码") Write #1,B.Name,B.Te1Num Close #1 End SubB.Private Sub Command1_Click() Dim B As Books Open"c":\Person.txt"For Input As #1 B.Name=InputBox("输入姓名") B.Te1Num=InputBox("输入电话号码") Prite #1,B.Name,B.Te1Num Close #1 End SubC.Private Sub Command1_Click() Dim B As Books Open"c":\Person.txt"For Output As #1 B.Name=InputBox("输入姓名") B.Te1Num=InputBox("输入电话号码") Write #1,B Close #1 End SubD.Private Sub Command1_Click() Open"c":\Person.txt"For Input As #1 Name=InputBox("输入姓名") Te1Num=InputBox("输入电话号码") Prite #1,Name,Te1Num Close #1 End Sub

设在工程中有一个标准模块,其中定义了如下记录类型:Type Books Name As String ( 10 Te1Num As String * 20End Type在窗体上添加一个名为Command1的命名按钮。要求当执行事件过程Command1_Click时,在顺序文件Person.txt中写入一条记录。请在横线中填入适当的内容,将程序补充完整。Private Sub Command1_Click() Dim B As____ Open "c:\person.txt"For Output As #1 B.Name=InputBox("输入姓名") B.Te1Num=InputBox("输入学号") Write#1,B.Name,B.Te1Num Close #1End Sub

假定在工程文件中有一个标准模块,其中定义了如下记录类型Type BooksName As String * 10TelNum As String * 20End Type要求当执行事件过程Command1_Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是( )。A.Private Sub Command1_Click()Dim B As BooksOpen "c:\Person.txt" For Output As #1B.Name = InputBox("输入姓名")B.TelNum = InputBox("输入电话号码")Write #1, B.Name, B.TelNumClose #1End SubB.Private Sub Command1_Click()Dim B As BooksOpen "c:\Person.txt" For Input As #1B.Name = InputBox("输入姓名")B.TelNum = InputBox("输入电话号码")Print #1, B.Name, B.TelNumClose #1End SubC.Private Sub Command1_Click()Dim B As BooksOpen "c:\Person.txt" For Output As #1Name = InputBox("输入姓名")TelNum = InputBox("输入电话号码")Write #1, BClose #1End SubD.Private Sub Command1_Click()Dim B As BookOpen "c:\Person.txt" For Input As #1Name = InputBox("输入姓名")TelNum = InputBox("输入电话号码")Print #1, B.Name, B.TelNumClose #1 End Sub

设有CYTD.DBF数据表,其记录中包含“姓名”字段,并且以它为关键字进行索引,索引文件为 CYXM.IDX。因为某种误操作使得该数据表中存在“姓名”重复记录,现在编了一个程序进行自动检测,并把重复记录删除。请在下面程序______处填写正确的内容,使程序能完成上述功能。SET TALK OFFUSE CYTD INDEX CYXMXM=姓名SKIPDO WHILE【 】XM1=姓名IF 【 】DELEELSEXM XM1ENDIFSKIPENDDO【 】USERETURN

设在工程文件中有一个标准模块,其中定义了下列记录类型: Type Books Name As String*10 TelNum As String*20 End,Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1 Click 时,在顺序文件Person.txt中写入一条Books类型的记录。下列能够完成该操作的事件过程是( )。A.Private Sub Command1 Click( ) Dim B AS Books Open"Person txt"For Output As#1 Name=InputBox(”输入姓名”) relNum=lnputBox(”输入电话号码”) Wlite#1 B Name,B TelNum Ch,se#1 End SubB.Private Sub Command1 Click( ) Dim B AS Books Open"Person txt"For Input As#1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print#1,B.Name,B.TelNam Close#1 End SubC.Private Sub Command1 Click( ) Dim BAS Books Open"Person txt"For Output As#1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Write#1,B Close#1 End SubD.Private Sub Commandl Click( ) Open"Person txt"For Input As#1 Name=lnputBox("输入姓名") TelNum=lnputBox("输入电话号码") Prim#1 Name TelNum Close#1 End Sub

在考生文件夹下有“xx”数据库。在“窗体1”窗体中添加标签和名称相同的文本框“请输入学号”和“学生姓名”,添加“显示学生姓名”按钮,编写程序实现输入学号后单击“显示学生姓名”按钮后显示学生姓名。要求用Dlookup()函数实现。窗体设计如图所示。

设在工程中有一个标准模块,其中定义了如下记录类型______。 Type Books Name As String*10 TelNum As String*20 End Type 在窗体上画一个名为Commandl的命令按钮,要求当执行事件过程Commandl_click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是______。A.Ptivate Sub Commandl Click() Dim B As Books Open"C:\Person.txt"For Output AS#1 BName=InputBox("输入姓名") BTelNum=InputBox("输入电话号码") Write#1,BName,BTeLNum Clodr#1 End SubB.Ptivate Sub Commandl_C1iok() Dim B As Books Opcn"c:\Person.txt"For Input As#1 BName=InputBox("输入姓名") BTelNum=InpuBox("输入电话号码") Print#1,BName,@B@TelNum C1ose#1 End SubC.Private Sub Commandl Click() Dim B As Books Open"c:\Person.txt"For Output As #1 BName=InputBox("输入姓名") BTelNum=InputBox("输入电话号码") Write#1、B Close#1 End SubD.Private Sub Command1 C1ick() Dim B As Books Open"c:\Person.txt"For Input As #1 Name=InputBox('输入姓名') TelNum=InputBox("输入电话号码") Print#1,Name,TelNum Close#1 End Sub

设在工程中有一个标准模块,其中定义了如下记录类型: Type Books Name As String * 10 TelNum As String * 20 EndType 在窗体中添加一个名为Commandl的命令按钮,要求单击命令按钮时,在顺序文件 Ptxt中写入一条记录。下列能够完成该操作的程序段是 ( )A.Private Sub Commandl_Click() Dim B As Books Open"d:\P1.txt"For Output As #1 B. Name=InputBox( "姓名") B. TelNum=InputBox("电话号码") Write #1,B. Name,B. TelNum Close #1 EndSubB.Private Sub Commandl_Click() Dim B As Books Open" d:\Pl.txt" For Input As B. Name=InputBox ("姓名") B. TelNum=InputBox ("电话号码") Print #1,B. Name,B. TelNum Close #1 EndSubC.Private Sub Commandl_Click() Dim B As Books Open"d:\P1. txt"For Output As B. Name=InputBox("姓名") B. TelNum=InputBox ("电话号码") Write #1,B Close #1 EndSubD.Private Sub Commandl Cliek() Open"d:\P1.txt" For Input As Name=InputBox("姓名") TelNum=InputBox ("电话号码") Print #1,Name,TelNum Close #1 EndSub

设在工程文件中有—个标准模块,其中定义了如下记录类型:Type Books Name As String *10 TelNum As String*20End Type在窗体上画—个名为Command1的命令按钮,要求当执行事件过程Command1_Click时,在顺序文件Petson.txt中写入一条Books类型的记录。下列能够完成该操作的事件过程是 ______。A.Private Sub Command1_ Click() Dim B As Books Open "Person.txt" For Output As #1 B. Name=InputBox(“输入姓名”) B. TelNum=InputBox(“输入电话号码”) Write #1, B. Name, B. TelNum Close #1End SubB.Private Sub Command1_ Click() Dim B As Books Open "Person.txt" For Input As #1 B. Name=InputBox(“输入姓名”) B.TelNum=InputBox(“输入电话号码”). Print #1, B. Name, B.TelNum Close #1End SubC.Private Sub Command1_Click() Dim B As Books Open "Person.txt" For Output As #1 B.Name= InputBox(“输入姓名”) B.TelNum=InputBox(“输入电话号码”) Write #1,B Close #1End SubD.Private Sub Command1_ Click() Open "Person. txt" For Input As #1 Name=InputBox(“输入姓名”) TelNum=InputBox(“输入电话号码”) Print #1, Name, TelNum Close #1End Sub

下面程序的功能是从键盘读取一行文本并将该文本存储到文件中。当用户运行该程序时,需要输入一行文本并按下回车键。然后在DOS系统提示符处输入type file.txt并按下Enter键,这时屏幕会显示type file.txt的内容。通过这个命令可以验证该程序的功能。请在每条横线处填写一条语句,使程序的功能完整。注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。源程序文件代码清单如下:import java.io.*;public class DoFile{public static void main(String args[]){byte buffername[]=______[80];try{System.out.println("\nEnter a line to be saved to disk:");int bytesbleck= ______;FileOutputStream f=new FileOutputStream("file.txt");______;}catch(Exception e){e.printStackTrace();}}}

假定在工程文件中有一个标准模块,其中定义了如下记录类型 Type Books Name As String*10 TelNum As String*20 End Type 要求当执行事件过程Commandl_Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是:A. Prirate Sub Commandl Click() Dim B As Books Open"C:\Person.txt"For Output As #1B.Name=InputBox("输入姓名")B.TelNum=InputBox("输入电话号码") Write #1,B.Name,B.TelNum Close #1 End SubB.Pdrate Sub Commandl Cliok() Dim B As Books Open"c:\Person.txt"For Input As #1B.Name=InputBox("输入姓名")B.TeINum=InputBox("输入电话号码") Print #1,B.Name,B.TelNum Close #1 End SubC.Private Sub Commandl Click() Dim B As Books Open"c:\Person.txt"For Output As #1 Name=InputBox("输入姓名") TelNunl=InputBox("输入电话号码") Write #1,B Close #1 End SubD.Private Sub Commandl Click() Dim B As Books Open"c:\Person.txt"For Input As #1 Name=InputBox("输入姓名") Temum=InputBox("输入电话号码") Write #1,B.Name,B.TelNuin Close #1 End Sub

设在工程中有一个标准模块,其中定义了如下记录类型Type Books Name As String *10 TelNum As String *20End Type在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_ Click时,在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是______。A.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name=InpuBox(“输入姓名”) B.TelNum=InputBox(“输入电话号码”) Write #1,B.Name,B.TelNum Close #1End SubB.Private Sub Command1_ Click() Dim B As Books Open "c:\Person.txt" For Input As #1 B.Name=InputBox(“输入姓名”) B.teLNum=InputBox(“输入电话号码”) Ptint #1,B.Name,B.TelNum Close #1End SubC.Private Sub Command1_ Click() Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name=InputBox(“输入姓名”) B.TelNum=InputBox(“输入电话号码”) Write #1,B Close #1End SubD.Private Sub Command1_ Click() Dim B As Books Open "c:\Person.txT" For Input As #1 Name=InputBox(“输入姓名”) TelNum=InputBox(“输入电话号码”) Print #1 Name. TelNum Close #1End Sub

设有学生表文件,要查找学生表中还没有输入姓名的记录,则SQL语句为:SELECT * FROM 学生表 WHERE 姓名______

设在工程中有一个标准模块,其中定义了如下记录类型 Type Books Name As String*10 TelNum As String*20 End Type 在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1_Click时, 在顺序文件Person.txt中写入一条记录。下列能够完成该操作的事件过程是______。A.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Write #1,B.Name,B.TelNum Close #1 End SubB.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Input As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Print #1, B.Name, B.TelNum Close #1 End SubC.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Output As #1 B.Name=InputBox("输入姓名") B.TelNum=InputBox("输入电话号码") Write #1, B Close #1 End SubD.Private Sub Command1_Click() Dim B As Books Open "c:\Person.txt" For Input As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print #1, Name, TelNum Close #1 End Sub

设在工程文件中有一个标准模块,其中定义了下列记录类型:Type BooksName As String*10TelNum As String*20End,Type在窗体上画一个名为Command1的命令按钮,要求当执行事件过程Command1 Click 时,在顺序文件Person.txt中写入一条Books类型的记录。下列能够完成该操作的事件过程是( )。A.Private Sub Command1 Click( )Dim B AS BooksOpenPerson txtFor Output As#1Name=InputBox(”输入姓名”)relNum=lnputBox(”输入电话号码”)Wlite#1 B Name,B TelNumCh,se#1End SubB.Private Sub Command1 Click( )Dim B AS BooksOpenPerson txtFor Input As#1Name=InputBox(输入姓名)TelNum=InputBox(输入电话号码)Print#1,B.Name,B.TelNamClose#1End SubC.Private Sub Command1 Click( )Dim BAS BooksOpenPerson txtFor Output As#1Name=InputBox(输入姓名)TelNum=InputBox(输入电话号码)Write#1,BClose#1End SubD.Private Sub Commandl Click( )OpenPerson txtFor Input As#1Name=lnputBox(输入姓名)TelNum=lnputBox(输入电话号码)Prim#1 Name TelNumClose#1End Sub

假定在工程文件中有一个标准模块,其中定义了如下记录类型: Type Books Name As String*10 TelNum As String*20 End Type 要求当执行事件过程Command1_Click时,在顺序文件Person. txt中写入一条记录。下列能够完成该操作的事件过程是______。A.Private Sub Command1_Click() Dim B As Books Open"c:\Person. txt" For Output As #1 B. Name=InputBox("输入姓名") B. TelNum=InputBox("输入电话号码") Write #1, B. Name, B. TelNum Close #1 End SubB.Private Sub Command1_Click() Dim B As Books Open"c:\Person txt" For Output As #1 B. Name=InputBox("输入姓名") B. TelNum=InputBox("输入电话导码") Print #1, B. Name, B. TelNum Close #1 End SubC.Private Sub Command1_Click() Dim B As Books Open"c:\Person. txt" For Output As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print #1, B Close #1 End SubD.Private Sub Command1_Click() Dim B As Books Open "c:\Person txt" For Output As #1 Name=InputBox("输入姓名") TelNum=InputBox("输入电话号码") Print #1, B Name, B. TelNum Close #1 End Sub

假设职员表已在当前工作区打开,其当前记录的“姓名”字段值为“张三”(字符型,宽度为6)。在命令窗口输入并执行如下命令:姓名=姓名-“您好”?姓名那么主窗口中将显示( )。A)张三B)张三您好C)张三你好D)出错

输入姓名组“NM:1姓名1姓名”时,系统若出现NAME LENGTH是在提醒用户()。A、姓名超长B、姓氏少于两个字符C、姓名中应加入斜线D、姓名中有非法字符

输入姓名组“NM:1姓名1姓名”时,系统若出现SEAT是在提醒用户输入的姓名数与座位数不符。

在显示查询结果时,若将数据表中的“name”字段名显示为“姓名”,应进行的相关设置是()A、在查询设计视图的“字段”行中输入“姓名”B、在查询设计视图的“显示”行中输入“姓名”C、在查询设计视图的“字段”行中输入“姓名:name”D、在查询设计视图的“显示”行中输入“姓名:name”

单选题在显示查询结果时,若将数据表中的“name”字段名显示为“姓名”,应进行的相关设置是()A在查询设计视图的“字段”行中输入“姓名”B在查询设计视图的“显示”行中输入“姓名”C在查询设计视图的“字段”行中输入“姓名:name”D在查询设计视图的“显示”行中输入“姓名:name”