当前位置: 首页 > news >正文

建一个公司网站多少钱上海公司排名大全

建一个公司网站多少钱,上海公司排名大全,石家庄的建筑公司,摄影网站免费实 验 目 的 掌握索引和关联数组#xff0c;以及下标和元素概念#xff1b; 掌握数组创建、初始化#xff0c;以及元素添加、删除、修改操作#xff1b; 掌握foreach作用、语法、执行过程和使用#xff1b; 能应用数组输出表格和数据。 任务1#xff1a;使用一维索引数… 实 验 目 的 掌握索引和关联数组以及下标和元素概念 掌握数组创建、初始化以及元素添加、删除、修改操作 掌握foreach作用、语法、执行过程和使用 能应用数组输出表格和数据。 任务1使用一维索引数组存储医生年龄(随机生成一组年龄数组年龄范围为22-60)使用foreach找出最大年龄、最小龄算出平均年龄。 任务2使用二维关联数组描述下表学生信息并用表格输出学生信息要求算出单科平均成绩。扩展选做借助数组函数分别按单科成绩从高到低排序。 姓名 英语成绩 数学成绩 语文成绩 张三 78 99 87 李四 88 88 79 老五 65 90 93 平均成绩 77 ? ? 任务一先搭建首页的页面 !DOCTYPE html html langenheadmeta charsetUTF-8meta http-equivX-UA-Compatible contentIEedgemeta nameviewport contentwidthdevice-width, initial-scale1.0titleDocument/titlestyle* {margin: 0;padding: 0;box-sizing: border-box;}.box {width: 800px;height: 200px;background-color: #e4dfdf;margin: 100px auto;padding-top: 15px;}.box h1 {text-align: center;font-weight: 400;}.box .num {width: 400px;height: 50px;}form {margin-top: 55px;font-size: 22px;}/style /headbodydiv classboxh1求医生年龄的最值/h1form actiondoctor_ages.php请输入您要生成的多少位医生的年龄input typenumber namenumber classnum/form/br/form/div /body/html 首页页面是给用户去生成多少位医生的年龄。 生成了多少位医生的年龄后去求医生的最大年龄和最小年龄和平均年龄。 实验步骤 ?php$Dnumber $_REQUEST[number]; Calculate($Dnumber);function Calculate($n){//创建一个年龄数组$ages array();for($i0;$i$n;$i){$ages[$i] rand(20,60);}echo 生成的数组是:;for($i0;$i$n;$i){if($i($n-1)){echo $ages[$i]. ;}else {echo $ages[$i] . , ;}}echo /br;$AgeMax $ages[0];$AgeMin $ages[0];$AgeSum0;for($i0;$i$n;$i){if($ages[$i]$AgeMax){$AgeMax$ages[$i];}if($ages[$i]$AgeMin){$AgeMin$ages[$i];}$AgeSum$AgeSum$ages[$i];} echo 医生的最大年龄是.$AgeMax./br;echo 医生的最小年龄是.$AgeMin./br;echo 医生的平均年龄.round($AgeSum/count($ages),2);} ? 任务二 使用HTMLCSS搭建琦基础页面 !DOCTYPE html htmlhead meta charsetutf-8 title菜鸟教程(runoob.com)/title link relstylesheet hrefhttps://cdn.staticfile.net/twitter-bootstrap/3.3.7/css/bootstrap.min.cssscript srchttps://cdn.staticfile.net/jquery/2.1.1/jquery.min.js/scriptscript srchttps://cdn.staticfile.net/twitter-bootstrap/3.3.7/js/bootstrap.min.js/scriptstyleh1 {text-align: center;}table {margin: 0 auto;}tr h2 {margin-left: 20px;}form input {width: 70%;height: 40px;margin-bottom: 5px;border-radius: 10px;}form label {padding-left: 20px;}form button {background-color: #5bc0de;border-color: #46b8da;display: inline-block;padding: 6px 12px;margin-bottom: 0;font-size: 18px;font-weight: 400;line-height: 1.42857143;text-align: center;white-space: nowrap;vertical-align: middle;-ms-touch-action: manipulation;touch-action: manipulation;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;background-image: none;border-radius: 4px;margin-left: 90px;margin-top: 10px;width: 69%;}form button a {color: #fff;}form button a:hover {color: #18f508;text-decoration: none;}/style /headbodytable width80% border0trtd colspan2 stylebackground-color:#FFA500;h1学生成绩查询/h1/td/trtrtd stylebackground-color:#FFD700;width:200px;vertical-align:top;h2添加学生成绩信息/h2form methodget actionlabel forname学生 姓名:/labelinput typetext idname namename placeholder姓名brlabel forenglishScore英语 成绩:/labelinput typenumber idenglishScore nameenglishScore min0 max100 placeholder英语成绩brlabel formathScore数学 成绩:/labelinput typenumber idmathScore namemathScore min0 max100 placeholder数学成绩brlabel forchineseScore语文 成绩:/labelinput typenumber idchineseScore namechineseScore min0 max100 placeholder语文成绩brbutton typesubmit namesubmita href添nbsp;nbsp;nbsp;加/a/buttonh2删除学生成绩信息/h2label forname学生 姓名:/labelinput typetext idname namedname placeholder姓名brbutton typesubmit namedsubmita href删nbsp;nbsp;nbsp;除/a/button/form/td 完整的代码 !DOCTYPE html htmlhead meta charsetutf-8 title菜鸟教程(runoob.com)/title link relstylesheet hrefhttps://cdn.staticfile.net/twitter-bootstrap/3.3.7/css/bootstrap.min.cssscript srchttps://cdn.staticfile.net/jquery/2.1.1/jquery.min.js/scriptscript srchttps://cdn.staticfile.net/twitter-bootstrap/3.3.7/js/bootstrap.min.js/scriptstyleh1 {text-align: center;}table {margin: 0 auto;}tr h2 {margin-left: 20px;}form input {width: 70%;height: 40px;margin-bottom: 5px;border-radius: 10px;}form label {padding-left: 20px;}form button {background-color: #5bc0de;border-color: #46b8da;display: inline-block;padding: 6px 12px;margin-bottom: 0;font-size: 18px;font-weight: 400;line-height: 1.42857143;text-align: center;white-space: nowrap;vertical-align: middle;-ms-touch-action: manipulation;touch-action: manipulation;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;background-image: none;border-radius: 4px;margin-left: 90px;margin-top: 10px;width: 69%;}form button a {color: #fff;}form button a:hover {color: #18f508;text-decoration: none;}/style /headbodytable width80% border0trtd colspan2 stylebackground-color:#FFA500;h1学生成绩查询/h1/td/trtrtd stylebackground-color:#FFD700;width:200px;vertical-align:top;h2添加学生成绩信息/h2form methodget actionlabel forname学生 姓名:/labelinput typetext idname namename placeholder姓名brlabel forenglishScore英语 成绩:/labelinput typenumber idenglishScore nameenglishScore min0 max100 placeholder英语成绩brlabel formathScore数学 成绩:/labelinput typenumber idmathScore namemathScore min0 max100 placeholder数学成绩brlabel forchineseScore语文 成绩:/labelinput typenumber idchineseScore namechineseScore min0 max100 placeholder语文成绩brbutton typesubmit namesubmita href添nbsp;nbsp;nbsp;加/a/buttonh2删除学生成绩信息/h2label forname学生 姓名:/labelinput typetext idname namedname placeholder姓名brbutton typesubmit namedsubmita href删nbsp;nbsp;nbsp;除/a/button/form/tdtd stylebackground-color:#eeeeee;height:550px;width:300px;vertical-align:top;padding-left:15px?php//二维数组$student array(张三 array(英语成绩 78, 数学成绩 99, 语文成绩 87),李四 array(英语成绩 88, 数学成绩 88, 语文成绩 79),王五 array(英语成绩 65, 数学成绩 90, 语文成绩 93));//平均值和最大值初始$average [英语成绩 0, 数学成绩 0, 语文成绩 0];$maxvalue [英语成绩 0, 数学成绩 0, 语文成绩 0];//添加修改用的button标签判断是否nullif (isset($_REQUEST[submit])) {//获取数据$name $_REQUEST[name];$englishScore $_REQUEST[englishScore];$chineseScore $_REQUEST[chineseScore];$mathScore $_REQUEST[mathScore];//判断数组中是否存在该键if (array_key_exists($name, $student)) {//存在提示echo 修改成功;} else {//不存在提示echo 添加成功!;}//存在替换不存在添加$student[$name] array(语文成绩 $chineseScore,数学成绩 $mathScore,英语成绩 $englishScore);}//删除if (isset($_REQUEST[dsubmit])) {//获取数据$name $_REQUEST[dname];//判断是否有键if (array_key_exists($name, $student)) {unset($student[$name]);echo 删除成功;} else {echo 没有该学生!;}}//遍历数组if ($student) {echo h2信息/h2;echo table border1;echo trth width150px姓名/thth width150px英语 成绩/thth width150px数学 成绩/thth width150px语文 成绩/th/tr;foreach ($student as $name $subjects) {//平均值先求和$average[英语成绩] $subjects[英语成绩];$average[数学成绩] $subjects[数学成绩];$average[语文成绩] $subjects[语文成绩];echo tr;echo td . $name . /td;//找出单科最高成绩foreach ($subjects as $subject $score) {if ($score $maxvalue[$subject]) {$maxvalue[$subject] $score;}echo td . $score . /td;}echo /tr;}//平均成绩求和结果除个数$average[英语成绩] / count($student);$average[数学成绩] / count($student);$average[语文成绩] / count($student);//取整数$average[英语成绩] round($average[英语成绩], 0);$average[数学成绩] round($average[数学成绩], 0);$average[语文成绩] round($average[语文成绩], 0);echo tr;echo td . 平均 . \n . /td . td . $average[英语成绩] . \n . /td . td . $average[数学成绩] . \n . /td . td . $average[语文成绩];echo /tr;echo tr;echo td . 单科最高成绩 . /td . td . $maxvalue[英语成绩] . /td . td . $maxvalue[数学成绩] . /td . td . $maxvalue[语文成绩] . /td;echo /tr;echo /table;}//运用数组函数排序rsort($student[张三]);rsort($student[李四]);rsort($student[王五]);echo br;echo 张三成绩降序排序;foreach ($student[张三] as $va) {echo \n . $va;}// echo 张三成绩排序.$student[张三][0].\n.$student[张三][1].\n.$student[张三][2];echo br;echo 李四成绩降序排序;foreach ($student[李四] as $va) {echo \n . $va;}echo br;echo 王五成绩降序排序;foreach ($student[王五] as $va) {echo \n . $va;}?/td/tr/table/body/html 注意本实验是笔者在校老师布置的任务。
http://www.pierceye.com/news/687532/

相关文章:

  • 如何做网站百度排名优化推广的目的是什么
  • 重庆忠县网站建设公司哪家专业芷江建设局的工作人员网站
  • 戴尔电脑网站建设方案范文室内设计方案图
  • 餐厅网站建设策划方案网站建设存在的具体问题
  • 竞价页面网站做优化广告商对接平台
  • 网站后台如何修改密码wordpress调整页面布局
  • 东莞热点网站建设莱州人才网
  • 线上渠道推广网站的优化哪个好
  • 群晖可以做网站服务器微信朋友圈怎么发链接那种网页怎么制作
  • wordpress 公司网站网站和公众号的区别
  • 数据库跟网站seo流程
  • 网站首页关键词设置网站的整体风格
  • wordpress源码站整站源码制作wordpress插件
  • 海口网站建设就q479185700上墙网站空间后台怎么进入
  • 四川电子有限公司 - 手机网站如何做网站家具导购
  • 网站经营性备案修改wordpress自带小工具
  • 网站怎么建设可以发图评论网站建设制作公
  • 做销售的网站设计公司是做什么的
  • 建设专业网站的利弊海淀区seo招聘信息
  • 吴江区住房与建设局网站网站开发怎么对接客户
  • frontpage2007网站建设网站开发需要redis
  • 国内做网站多少钱ui中有哪些做的好看的网站
  • 金湖建设工程质量监督网站网页设计 网站建设 哪个好
  • 适合做外链的网站梧州论坛红豆思辨
  • 永城网站设计公司wordpress 获取父分类
  • 网站开发语言是什么东莞营销网站建设价格
  • 外贸公司访问国外网站中学生做的网站有哪些方面
  • 南城网站建设公司信息wordpress怎样显示文章全部列表
  • 做推广什么网站便宜企业网站管理系统湖南岚鸿
  • 电影下载网站 怎么做flash翻页效果网站模板