Question

1. What condition makes the loop output the even numbers 2 through 20? var c =...

1. What condition makes the loop output the even numbers 2 through 20?

var c = 2;

while (_____) {

   console.log(c);

   c += 2;

}

a). c >= 20

b). c <= 20

c). c < 20

2. lowerCaseLetters = "abc";

upperCaseLetters = "ABC";

if (lowerCaseLetters > upperCaseLetters) {

   length++;

}

a). true

b). false

3. score = 2;

if (score === "2") {

   score = 10;

}

a).true

b).false

4. Indicate if the statements contain an error or not.

/* a is assigned 2

a = 2;

a.)Error

b).No error

5. What is the data type of z?

var z;

a).undefined

b).string

c).number

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)
Answer: c<=20
loop runs upto c=20 from c=2, printing every even number
2)
Answer:True
lowercase string has higher ascii value than uppercase
3)
Answer:False
both are of different type
4)
Answer:a)Error
variable a is not declared
//if a is already delcared then it is not error
5)
Answer:a)undefined

Add a comment
Know the answer?
Add Answer to:
1. What condition makes the loop output the even numbers 2 through 20? var c =...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using C++ 1. Create a while loop that counts even numbers from 2 to 10 2....

    Using C++ 1. Create a while loop that counts even numbers from 2 to 10 2. Create a for loop that counts by five (i.e. 0, 5, 10, ...) from 0 to 100 3. Ask for a person's age and give them three tries to give you a correct age (between 0 and 100) 4. Use a for loop to list Celsius and Fahrenheit temperatures. The "C" should be from -20 to 20 and the F should be shown correspondingly...

  • 1. (a) Before entering any while loop, the while loop condition is. . . A. true...

    1. (a) Before entering any while loop, the while loop condition is. . . A. true B. false C. true or false (b) At the beginning of each iteration, a while loop condition is. . . A. true B. false C. true or false (c) When the loop terminates, a while loop condition is. . . A. true B. false C. true or false (d) Which of the following statements will not cause a compile-time error? A. byte b =...

  • 1. var s = "A red boat"; var a = s.split(" "); what is the value...

    1. var s = "A red boat"; var a = s.split(" "); what is the value of a? var b = [9, 3, 2, 1, 3, 7]; var c = b.slice(2, 5); What is the value of c? var d = c.concat(a); alert(d.join("**")); [ 'A', 'red' , 'boat'] [ 2 , 1, 3] 2**1**3**A**red**boat [ 'A', 'red' , 'boat'] [ 1 , 3, 7] 8**A**red**boat [ 'A', 'red' , 'boat'] [ 3 , 2, 1] A**red**boat [ 'A', 'red' ,...

  • Question 21 The loop condition can be a complex condition involving several operators. True OR False...

    Question 21 The loop condition can be a complex condition involving several operators. True OR False Question 22 final int MAX = 25, LIMIT = 100; int num1 = 12, num2 = 25, num3 = 87; if(num3-5 >= 2*LIMIT) { System.out.println ("apple"); } else { System.out.println ("orange"); } System.out.println("grape"); What prints? A. Apple B. Orange C. Grape D. apple grape E. orange grape F. Nothing. Question 23 When we use a while loop, we always know in advance how many...

  • 31. True or False: The condition in the following if statement is a syntax error:

     31. True or False: The condition in the following if statement is a syntax error: int number=50;…… if (number)…… 32. True or False: The standard C functlon strlen) will return 4 when invoked upon the varlable name, declared below: char namel = (e', 'p', 't', 's', '\0', '1', '2', '1', '\0']; 33. True or False: A structure is a collection of related variables under one name. 34. True or False: In C, output parameters allow for a function to return more than one value Indirectly. 35. True or...

  • 2. What is the output of the following code fragment? n = 1; while (n <=...

    2. What is the output of the following code fragment? n = 1; while (n <= 5) { n++; cout << n << ' '; a.1 2 3 4 5 b. 1 2 3 4 c. 1 1 1 forever d. 2 3 4 5 e. 2 3 4 5 6 3. What is the termination condition for the following While loop? while (beta > 0 && beta < 10) { cout << beta << endl; cin >> beta; }...

  • 1. Let X and Y be two random variables.Then Var(X+Y)=Var(X)+Var(Y)+2Couv(X,Y). True False 2. Let c be...

    1. Let X and Y be two random variables.Then Var(X+Y)=Var(X)+Var(Y)+2Couv(X,Y). True False 2. Let c be a constant.Then Var(c)=c^2. True False 3. Knowing that a university has the following units/campuses: A, B , the medical school in another City. You are interested to know on average how many hours per week the university students spend doing homework. You go to A campus and randomly survey students walking to classes for one day. Then,this is a random sample representing the entire...

  • C++ help! #4,6,7 c) no-test d) loop-test e) None of these 1. Which of the following...

    C++ help! #4,6,7 c) no-test d) loop-test e) None of these 1. Which of the following variable names is invalid? a) numstudents b) 2Darray c) studentHame d) test Grade 祁.which of the following conditions is true ifX has a value of 10 and T has a value of 20? None of these 2. In Ca4, the operator indicates: a) subtraction b) negation c) equality e) None of these . What are the final values of z and y after the...

  • need asap Homework (5) 1. There are two basic forms of loop constructs: - and 2....

    need asap Homework (5) 1. There are two basic forms of loop constructs: - and 2. Which of the following is an alternate and faster way of performing the same function as many MATLAB for loops? a) a. Exhaustive enumeration b) b. Vectorization c) c. Variable declaration d) d. Amortization 3. A while loop is a block of statements that are repeated indefinitely as long as some condition is satisfied. a) True b) False 4. The for loop is a...

  • 1) Which of the following is NOT true about a Python variable? a) A Python variable...

    1) Which of the following is NOT true about a Python variable? a) A Python variable must have a value b) A Python variable can be deleted c) The lifetime of a Python variable is the whole duration of a program execution.   d) A Python variable can have the value None.        2) Given the code segment:        What is the result of executing the code segment? a) Syntax error b) Runtime error c) No error      d) Logic error 3) What...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT