
Dim b(1 To 40) As String, d As Double, f As Integer, g As Integer, h As Integer, e As Integer
Private Sub Command1_Click()
If Command1Caption = "开始" Then
Command1Caption = "暂停"
Timer1Enabled = True
ElseIf Command1Caption = "暂停" Then
Command1Caption = "继续"
Timer1Enabled = False
Else
Command1Caption = "暂停"
Timer1Enabled = True
End If
End Sub
Private Sub Command2_Click()
Command1Caption = "开始"
Text1Text = ""
Text2Text = ""
Label1Caption = ""
Timer1Enabled = False
For u = 1 To 40
a = Int(Rnd 10)
If a Mod 2 = 0 Then
b(u) = Chr(Int(Rnd 26) + 65)
Else
b(u) = Chr(Int(Rnd 26) + 97)
End If
Text1Text = Text1Text & b(u) & " "
Next
End Sub
Private Sub Form_Load()
For u = 1 To 40
a = Int(Rnd 10)
If a Mod 2 = 0 Then
b(u) = Chr(Int(Rnd 26) + 65)
Else
b(u) = Chr(Int(Rnd 26) + 97)
End If
Text1Text = Text1Text & b(u) & " "
Next
End Sub
Private Sub Text2_Change()
If Len(Text2Text) = 80 Then
Timer1Enabled = False
For u = 1 To 40
If b(u) = Mid(Text2Text, 2 u - 1, 1) Then
c = c + 1
End If
Next
MsgBox " 你本次训练时间为: " & g & "时" & h & "分" & f & "秒" & e & " 正确率为: " & (c / 40) 100 & "%"
End If
End Sub
Private Sub Timer1_Timer()
d = d + 100
g = Int(d / 3600000)
h = Int(d / 60000 - 60 g)
f = d / 1000 - g 3600 - h 60
e = d \ 100
Label1Caption = g & "时" & h & "分" & f & "秒" & e
End Sub
这是我刚写的 开始 text里面 随机的是 字母 区分大小写的 每个字母之间 还有 空格 隔开的 你先试试 有疑问再联系我!!!
你可以参考下这个程序 自己写的永远要比原搬别人的强 #include<stdioh>
#include<stringh>
struct studentInfo
{
char names[20];
char sex[4];
int age;
char tel[14];
};
struct studentInfo list[1000];
int count;
char choose;
int chooses;
int i;
showWelcome()
{
printf("\n");
printf(" 欢迎进入通讯录系统 \n");
printf("\n");
}
showMainMenu()
{
printf("1、录入学员信息\n");
printf("2、显示全部信息\n");
printf("3、查找学员信息\n");
printf("4、删除学员信息\n");
printf("5、修改学员信息\n");
printf("0、退出菜单\n");
}
insertStudentInfo()
{
printf("录入学员信息\n");
do
{
printf("姓名:");
scanf("%s",list[count]names);
printf("性别:");
fflush(stdin);
scanf("%s",list[count]sex);
printf("年龄:");
scanf("%d",&list[count]age);
printf("电话:");
scanf("%s",list[count]tel);
count++;
printf("是否继续(y/n):");
fflush(stdin);
scanf("%c",&choose);
}while(choose=='y'||choose=='Y');
}
showStudentInfo()
{
printf("所有学员信息如下:\n");
printf("姓名\t性别\t年龄\t电话\n");
for(i=0;i<count;i++)
{
printf("%s\t%s\t%d\t%s\n",list[i]names,list[i]sex,list[i]age,list[i]tel);
}
}
searchStudentInfo()
{
char name[50];
printf("请输入您要查询的学员姓名:");
scanf("%s",name);
for(i=0;i<count;i++)
{
if(strcmp(name,list[i]names)==0)
{
printf("您要查找的学员信息如下:\n");
printf("姓名:%s\n性别:%s\n年龄:%d\n电话:%s\n",list[i]names,list[i]sex,list[i]age,list[i]tel);
break;
}
}
if(i==count)
printf("很遗憾,没有查找到您需要的信息。\n");
}
shanchuStudentInfo()
{
do{
char shanchu[20];
printf("请输入你要删除的学员姓名:");
scanf("%s",shanchu);
for(i=0;i<count;i++)
{
if(strcmp(shanchu,list[i]names)==0)
{
for(i=0;i<count;i++)
{
list[i]=list[i+1];
}
count--;
printf("删除完毕!\n");
}
else
printf("对不起没有找到该学员!\n");
}
printf("继续删除吗(y/n):");
fflush(stdin);
scanf("%c",&choose);
}while(choose=='y'||choose=='Y');
}
xiugaiStudentInfo()
{
do{
char xiugaixm[20];
char xiugaixb[5];
int xiugainl;
char xiugaidh[14];
printf("请输入你要修改的学员姓名:");
scanf("%s",xiugaixm);
for(i=0;i<count;i++)
{
if(strcmp(xiugaixm,list[i]names)==0)
{
printf("1姓名:%s\n2性别:%s\n3年龄:%d\n4电话:%s\n",list[i]names,list[i]sex,list[i]age,list[i]tel);
printf("请选择你要修改的内容:");
scanf("%d",&chooses);
switch(chooses)
{
case 1:
printf("请输入修改后姓名:");
scanf("%s",xiugaixm);
strcpy(list[i]names,xiugaixm);
break;
case 2:
printf("请输入修改后性别:");
scanf("%s",xiugaixb);
strcpy(list[i]sex,xiugaixb);
break;
case 3:
printf("请输入修改后年龄:");
scanf("%d",&xiugainl);
list[i]age=xiugainl;
break;
case 4:
printf("请输入修改后电话:");
scanf("%s",xiugaidh);
strcpy(list[i]tel,xiugaidh);
break;
default:
printf("输入错误,请核实。\n");
break;
}
printf("修改后信息如下:\n");
printf("姓名:%s\n性别:%s\n年龄:%d\n电话:%s\n",list[i]names,list[i]sex,list[i]age,list[i]tel);
}
else
printf("对不起,没有找到该学员信息!\n");
}
printf("继续修改吗(y/n):");
fflush(stdin);
scanf("%c",&choose);
}while(choose=='y'||choose=='Y');
}
void main()
{
showWelcome();
do
{
showMainMenu();
printf("请选择功能:");
scanf("%d",&chooses);
switch(chooses)
{
case 1:
insertStudentInfo();
break;
case 2:
showStudentInfo();
break;
case 3:
searchStudentInfo();
break;
case 4:
shanchuStudentInfo();
break;
case 5:
xiugaiStudentInfo();
break;
case 0:
break;
default:
printf("输入错误,请核实。\n");
break;
}
}while(chooses!=0);
printf("\n谢谢使用本软件,再见!\n");
}
用 JavaSwing 编写程序,设置n个button,A,B,C 。
然后每个加 keyListener(键盘监听),在该方法里实现你要的功能即可
如果不需要显示模拟键,只需要在一个显示 JText 上 加keyListener 即可。
原理是一样的。
毫无意义的问题
当你会写代码的时候,自然打字速度就快了
程序员对打字速度没有要求,只要你有思路自然就快了
键盘就那些键,你每天都按自然就快了,而且写程序又不是写英文,需要记住的关键字又少,就那些英文的组合,你说你打多了能不快吗
我一分钟打250-300个左右的英文字母,每天的代码行要看情况,而且没有哪个人会无聊到去刻意的去算这个
我的第一个VB程序就是这样的,哈哈~跟你上面说的一模一样,好像就是我当时的设计
我的比你上面说的还多些功能,共有:键盘指法+单字练习+单词练习+整篇文章的练习和爬行榜
当时是边学边写的,一个星期搞定的,自己感觉还不错,还比较华丽,动画效果还不错。
10几年前的东东了,程序代码要去找,积分太少,不值
Dim m, s As Double
Private Sub Command1_Click()
Text2Text = ""
Text1Text = ""
For i = 1 To 30
Text2Text = Text2Text & Chr(Int(Rnd 25 + 66))
Next i
Timer1Enabled = True
Timer1Interval = 1000
m = 0
s = 1
End Sub
Private Sub Command2_Click()
Dim b As Integer
For i = 1 To 30
If Mid(Text1Text, i, 1) = Mid(Text2Text, i, 1) Then b = b + 1
Next i
Text3Text = Int(b / 30 100) & "%"
Timer1Enabled = False
Timer1Interval = 0
Text4Text = m & "分" & s & "秒"
End Sub
Private Sub Form_Load()
Text3Text = ""
Text4Text = ""
Text2Text = ""
Text1Text = ""
For i = 1 To 30
Text2Text = Text2Text & Chr(Int(Rnd 25 + 66))
Next i
Command1Caption = "重新生成"
Command2Caption = "计算"
Label1Caption = "准确率"
Label2Caption = "用时"
Text1Locked = True
Text1MaxLength = 30
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 And Len(Text1Text) >= 1 Then Text1Text = Left(Text1Text, Len(Text1Text) - 1)
If KeyAscii > 64 And KeyAscii < 91 Then Text1Text = Text1Text & Chr(KeyAscii)
If KeyAscii > 96 And KeyAscii < 123 Then Text1Text = Text1Text & Chr(KeyAscii - 32)
End Sub
Private Sub Timer1_Timer()
If s > 60 Then s = 0: m = m + 1
s = s + 1
End Sub
以上就是关于跪求用VB编写英文打字程序。全部的内容,包括:跪求用VB编写英文打字程序。、c++程序设计英文打字练习程序、java如何编写打字软件等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)