• 2021-04-14
    【单选题】下面的if语句统计满足“性别(gender)为男、职称(rank)为教授、年龄(age)小于40岁”条件的人数,正确的语句为 (2.0分)
    A. if (gender=="男" or age<40 and rank="教授"): n+=1 B. if (gender=="男" and age<40 and rank="教授"): n+=1 C. if (gender=="男" and age<40 or rank="教授"): n+=1 D. if (gender=="男" or age<40 and or="教授"): n+=1
  • if (gender=="男" and age

    举一反三

    内容

    • 0

      下面If语句统计满足职称(用字符串变量duty表示)为副教授或教授、且年龄(用整型变量age表示)小于40岁条件的人数,正确的语句是______。 A: If age &lt; 40 And (duty = &quot;教授&quot; or duty = &quot;副教授&quot;) Then n = n + 1 B: If age &lt; 40 And duty = &quot;教授&quot; or duty = &quot;副教授&quot; Then n = n + 1 C: If age &lt; 40 And duty = &quot;教授&quot; or &quot;副教授&quot; Then n = n + 1 D: If age &lt; 40 Or duty = &quot;教授&quot; And duty = &quot;副教授&quot; Then n = n + 1

    • 1

      中国大学MOOC:下面If语句统计满足性别(sex)为男、职称(duty)为副教授以上、年龄(age)小于40岁条件的人数,不正确的语句是()。

    • 2

      Ingeneral,inasocialsetting,()isthe"trumpcard"anddeterminesthehigherrank;womenarealwaysrankedovermen. A: rank B: age C: gender D: authority

    • 3

      下列( )方法定义和调用的代码是正确的。 A: static void Introduce(string gender = "男", string name, int age = 18){} Introduce(name: "alex", age: 20); B: static void Introduce(string name, int age = 18, string gender = "男"){} Introduce(age: 20, name: "alex"); C: static void Introduce(string gender = "男", string name, int ago = 18){} Introduce(age: 20, name: "alex"); D: static void Introduce(string name, int age = 18, string gender = "男"){}Introduce(name: "alex", age: 20);

    • 4

      【单选题】生成如下数据框的语句是? weight height gender age 1 80 180 male teen 2 75 170 male teen 3 60 165 female adult 4 52 150 female adult A. X ,gender=c("male", "male", "female", "female"),age=c("teen","teen","adult","adult")) B. X ,gender=c("male", "male", "female", "female"),age=c("teen","teen","adult","adult")) C. X ,gender=c(male, male, female, female),age=c(teen,teen,adult,adult)) D. X ,gender=c("male", "male", "female", "female"),age=c("teen","teen","adult","adult"))