请您输入您的出生日期,下面的程序将您出生的是周几
2012-04-26 16:49
274 查看
编写将出生日期转换为周几的程序
通过编写这个程序我不仅知道自己是周几出生的,更重要的是我学到了vb知识,感觉挺有意思的,虽然编写过程挺难理解的,但我会一点点慢慢学习的。
下面是编写过程:
Dim Year as Integer
Dim Month as Integer
Dim Day as Integer
Dim Dayofweek as Byte
Dim Birthday as Date
Year=Int(Val(Text1.Text))
Month=Int(Val(Text2.Text))
Day=Int(Val(Text3.Text))
Birthday=Dateserial(Year,Month,Day)
Dayofweek=Weekday(Birthday)
Label6.caption=Weekdayname(n)
End sub
Private Function Myweekdayname(Dayofweek as integer)as string
select case n
case 1
Myweekdayname=“星期天”
case 2
Myweekdayname="非星期天"
End select
End Function
通过对这个编程的编写我发现我对vb理解的太肤浅,需要认真的揣摩其中的细节,我要谨小慎微从小细节做起,是自己更好的应用这门学科。
通过编写这个程序我不仅知道自己是周几出生的,更重要的是我学到了vb知识,感觉挺有意思的,虽然编写过程挺难理解的,但我会一点点慢慢学习的。
下面是编写过程:
Dim Year as Integer
Dim Month as Integer
Dim Day as Integer
Dim Dayofweek as Byte
Dim Birthday as Date
Year=Int(Val(Text1.Text))
Month=Int(Val(Text2.Text))
Day=Int(Val(Text3.Text))
Birthday=Dateserial(Year,Month,Day)
Dayofweek=Weekday(Birthday)
Label6.caption=Weekdayname(n)
End sub
Private Function Myweekdayname(Dayofweek as integer)as string
select case n
case 1
Myweekdayname=“星期天”
case 2
Myweekdayname="非星期天"
End select
End Function
通过对这个编程的编写我发现我对vb理解的太肤浅,需要认真的揣摩其中的细节,我要谨小慎微从小细节做起,是自己更好的应用这门学科。
相关文章推荐
- 根据输入显示一个人的出生日期(我的第二个python程序)
- 编写将出生日期转换为周几的程序
- 根据输入显示一个人的出生日期(我的第二个python程序)
- C语言下不使用日期函数输入任意日期计算周几的程序
- 根据输入的日期 获得当前日期为周几
- java--封装一类Java对象,用户从输入对话框输入两个日期,程序将判断两个日期的大小关系(比如输出:您输入的第二个日期大于第一个日期)以及两个日期之间的间隔天数(比如输出:2006年6月6日和
- 编写程序,该程序启动后用户可以按“yyyy-MM-dd”的格式输入一个日期,程序计算这一天是星期几,并且计算出是一年中的第几天
- 、输入某人出生日期(以字符串方式输入,如1987-4-1)使用DateTime和TimeSpan类,(1)计算其人的年龄;(2)计算从现在到其60周岁期间,总共多少天。
- 求出此人的年龄。 C语言编程输入某人出生日期(y1:m1:d1:)和今天的日期(y2:m2:d2)
- //编写一个程序,显示用户输入的一个日期是该年度的第几天。
- 根据用户输入的二代身份证号码自动为其计算生成出生日期的javascript方法
- 根据身份证号,使用Java编写程序获取年龄、性别、出生日期
- 例题:输入您的出生日期,判断你的星座,主要练习使用datetime类及if else语句。很实用
- 输入日期求星期的程序
- 输入身份证自动生成出生日期(2)
- 编写程序提示用户输入日期,输出这天为星期几。
- JAVA 通过输入的出生日期,计算出岁数
- android程序一个注册,然后到设置兴趣爱好,出生日期,然后把所有信息显示在另一个页面的程序
- C#练习——统计整型数组中不重复数字的个数、将普通日期格式转换成汉字日期格式、在控制台录入每个学生的姓名,当用户输入quit(不区分大小写)时,程序停止接受用户的输入,并且显示出用户输入的学生的个数
- 编写程序提示用户输入日期,输出这天为星期几。