2003VFP程序改错题2-1
1.下列程序实现字母转换:输入字符串中出现英文字母均转化为顺序排列在该字母后面的第五个字母(26个字母相接顺序排列).
CLEAR
SET TALK OFF
ACCEPT TO B
L=LEN(B)
C=""
FOR I=1 TO L
A=SUBSTR(B,I,1) &&********1*******
A=??
everything but the girl
DO CASE
CASE A>="a" AND A<="u" OR A>="A" AND A<="U"
A=CHR(ASC(A)+5)
CASE A>="v" AND A<="z" OR A>="V" AND A<="Z"
A=CHR(ASC(A)-21) &&*******2********
A=CHR(ASC(A)-26)
ENDCASE
C=C+A
ENDFOR
B+"--->"+C
SET TALK ON
.2.从键盘输入一个实数M,求出该数的整数位数、小数位数和整体输入位数。
SET TALK OFF
CLEAR
INPUT "X=" TO X
IF X=0
jingle bells mp3"小数位数为:0,整数位数为:0,"+"该数的实际输出位数为:1。"
ENDIFleavin
ZS=INT(ABS(X))
ZSW=0
DO WHILE ZS>0
bitc
ZS=INT(ZS/10)&&********1******
ZS=MOD(ZS/10)
ZSW=ZSW+1
ENDDO
XSW=0
DO WHILE INT(X)#X
automatic是什么意思X=X*10 / X=10*X &&********2******
X=MOD(X,10)
XSW=XSW+1
ENDDOan error occurred
FJW=IIF(X<0,1,0)+IIF(XSW=0,0,1)
"整数位数为:"+STR(ZSW,5)+",小数位数为:"+STR(XSW,5)
"该数的实际输出位数为:"+STR(XSW+FJW+ZSW,2)
SET TALK ON
3..将学生表中的指定学生的奖学金增加100元
学生表:学号(C ),姓名(C),奖学金(N)
SET TALK OFF
CLEAR
USE 学生
lo过去式ACCEPT "请输入学生学号:" TO XH
LOCATE FOR 学号=XH / LOCA FOR XH=学号/ LOCATE FOR ALLT(学号)=ALLT(XH) / LOCA FOR ALLT(XH)=ALLT(学号) &&*****1*****
SEEK学号=XH
IF !EOF()
REPL 奖学金WITH 100 &&*****2*****
REPLACE ALL 奖学金WITH 100
学号,姓名,奖学金
2020年高考英语
ELSE
"没有找到!"
ENDIF
USE
SET TALK ON
4. 判断输入的年份是否是闰年.(能被4整除但不能被100整除,或能被100整除且能被400整除).
SET TALK OFF
CLEAR
INPUT ‘Y=’ TOY&&*****1*****
ACCEPT "Y=" TO Y
IF (Y%4=0 AND Y%100<>0) OR (Y%100=0 AND Y%400=0) /IF (Y%4=0 AND Y%100!=0) OR (Y%100=0 AND Y%400=0) IF (MOD(Y,4)=0 AND Y%100<>0) OR (MOD(Y,100)=0 AND MOD(Y,400)=0)/IF (MOD(Y,4)=0 AND Y%100!=0) OR (MOD(Y,100)=0 AND MOD(Y,400)=0) &&*****2*****
IF (Y%4 AND Y!%100) AND (Y%100 AND Y!%400)
Y,"是闰年!"
ELSE英语翻译价格
Y,"不是闰年!"
ENDIF
SET TALK ON
5查找学生表中指定班级(如951班)的奖学金总额.
时尚化妆培训学生.DBF
学号姓名性别奖学金
C,6 C,8 L,1 N,6
SET TALK OFF
CLEAR
USE 学生
INPUT …请输入班级? TO BJ
LOCATE FOR LEFT(学号,3)=BJ