黄土堂香主
阅读权限 2
积分 5274
侠名
UID 1120
主题
帖子
精华
好友
银子
金子
贡献
威望
推广
活跃
荣耀
注册时间 2018-11-19
最后登录 1970-1-1
在线时间 小时
个人主页
|
发表于 2018-11-26 10:38:01
|
显示全部楼层
var father:int = 62;
var wife:int = 37;
var self:int = 39;
var daughter:int = 10;
var son:int = 2;
const TOLTAL:int = 5;
var average:Number;
var answer:String = "我家的平均年龄为:";
average=(father+wife+self+daughter+son)/TOLTAL;
trace("练习1结果:"+answer+average);
/*以上是练习1:数字记录一切*/
var friends:Array = ["赵玲","李萍","于传颂","张诚","李刚"];
friends[5] = "赛阳";
friends[6] = "文子";
friends[0] = "习近平";
trace("这是练习2的结果:"+"我的朋友共"+friends.length+"人,他们是:"+friends);
/*以上是练习2:周围人的名字*/
var M1:Object = {name:"习近平",age:65,nation:"汉族"};
var M2:Object={};
M2.name = "李克强";
M2.age = 64;
M2.nation = "汉族";
var M3:Object = {};
M3["name"] = "周杰伦";
var a:String = "age";
M3[a] = "38";
M3["nation"] = "汉族";
var M4:Object = {name:"张学友",age:56,nation:"汉族"};
var M5:Object = {name:"杨幂",age:30,nation:"汉族"};
M5.characteristic="一个大美女!!"
trace("这是练习3的结果:"+"我熟悉的五个名人分别是"+M1.name+"、"+M2.name+"、"+M3.name+"、"+M4.name+"、"+M5.name);
trace(M1.name+"的年龄是:"+M1.age);
trace(M3.name+"的年龄是:"+M3[a]);
trace(M5.name+"的民族是:"+M5.nation);
trace(M5.name+"的特征是:"+M5.characteristic);
/*以上是练习3:十个名人自我介绍*/
再发作业,不要银子!!!只希望T老师看到后能抖擞精神,振奋气势,完成教程的编写!!好东西不怕剩,是金子总会发光!!我很喜欢T老师的教程,坚持写下去吧!哪怕风雨过后没有彩虹,我们也要在风雨中坚定地前行!!! |
|