20180626Day 002

xiaoxiao2021-02-28  9

一、JavaScript 编程题

下面两个函数的返回值是一样的吗?为什么?

function foo1() {    return {        bar: "hello"    };}function foo2() {    return    {        bar: "hello"    };

}

不一样,第一个返回的是object,第二个返回的是undefined

return 、break、continue 等语句,如果后面紧跟换行,解析器一定会自动在后面填充分号(;)

二、MySQL 编程题

用一条 SQL 语句,查询出每门课都大于 80 分的学生姓名。

表名 student_score

namecoursescore张三语文81张三数学75李四语文76李四数学90王五语文81王五数学100王五英语90

SELECT name FROM student_score GROUP BY name HAVING MIN(score)>80;

三、Java 编程题

一球从 100 米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在第 10 次落地时,共经过多少米?第 10 次反弹多高?

package test;public class Test{public static double sumBallHeight(double h, int n){  if (n == 1)     return h / 2;   else       return sumBallHeight ( h / 2,n - 1);         }  public static void main (String[ ] args){     System.out.printIn(sumBallHeight(100, 10));   }}
转载请注明原文地址: https://www.6miu.com/read-1750317.html

最新回复(0)