QUESTION 14
"Given this object, how would you assign the model to a variable named m?
var myCar = {make: 'Plymouth', model: 'Valiant', year: 1968}"
|
myCar.model(m); |
||
|
m = model.myCar; |
||
|
m = model.model; |
||
|
m = myCar.model; |
QUESTION 19
This program will produce an error. Why?
var x;
for(var i = 0; i < 12; i++) {
x = x + 2;
}
|
the variable i is illegally declared |
||
|
there is an attempt to read the value of x before x has been assigned a value |
||
|
the for-loop will never execute |
||
|
this program will not produce an error |
QUESTION 20
How many times will
this loop execute?
var x = 0;
for(var i = 8; i >= 3; i--) {
x = x + 2;
}
|
7 |
||
|
5 |
||
|
6 |
||
|
0 |
Question 14) :
"Given this object, how would you assign the model to a variable named m?
var myCar = {make: 'Plymouth', model: 'Valiant', year: 1968}"
Answer :
m = model.myCar;
Question 15) :
This program will produce an error. Why?
var x;
for(var i = 0; i < 12; i++) {
x = x + 2;
}
Answer : this program will not produce an error.
Question 16) : How many times will this loop
execute?
var x = 0;
for(var i = 8; i >= 3; i--) {
x = x + 2;
}
Answer : 6.
QUESTION 14 "Given this object, how would you assign the model to a variable named m?...
Given a double variable named x that has been declared and given a value, let's use a binary search technique to assign an estimate of its square root to another double variable, root that has also been declared. Let's assume that x's value is greater than 1.0 -- that will simplify things a bit. Here's the general idea: Since x>1, we know its square root must be between 1 and x itself. So declare two other variables of type double...
Question 2 (a) Provide a single line of C++ code that will declare a variable that points to a string value, the variable is named x. [2 marks] (b) You have array c declared as string *c [5]; Give the single line of C+ + code that will assign the string pointer stored in variable x (from above) to the third element of the array c. [2 marks] (c) Write a for loop that initialises the contents of each element...
QUESTION 1 Given two double variables named x and y, which of the following statements could you use to initialize both variables to a value of 0.0? a. x | y = 0.0; b. x = y = 0.0; c. x, y = 0.0; d. none of the above 1 points QUESTION 2 When you use a range-based for loop with a vector, you a. can avoid out of bounds access b. must still use a counter variable c....
QUESTION 1 What statement would you use to print the phrase “Hello, world” and then start a new line? QUESTION 2 What statement would you use to assign the value 32 to the variable cheeses? QUESTION 3 What statement would you use to read a value from keyboard input into the variable cheeses? QUESTION 4 What statement would you use to print “We have X varieties of cheese,” where the current value of the cheeses variable replaces X? QUESTION 5...
QUESTION 1 What statement would you use to print the phrase “Hello, world” and then start a new line? Path: pWords:0 10 points Save Answer QUESTION 2 What statement would you use to assign the value 32 to the variable cheeses? Path: pWords:0 10 points Save Answer QUESTION 3 What statement would you use to read a value from keyboard input into the variable cheeses? Path: pWords:0 10 points Save Answer QUESTION 4 What statement would you use to print...
PLEASE ANSWER ALL OF THEM, I REALLY APPRECIATE IT
PLEASE IGNORE THE SELECTED ANSWERS
Question 9 3 pts Which best describes the meaning of a 1 (true) being output? Assume v is a large array of ints. int i; bool si for (i = 0; i < N_SIZE; Hi) { if (v[i] < 0) { S-true; else S = false; } cout << si O first value is negative all values are negative some value other than the last is...
linear
Question Help 6.6.8-M 2 + There is no A simple curve that often makes a qood model for the variable cost of a company as a function of the sales level x. has the form y= constant term because fixed costs are not included. Complete parts (a) through (b) ("T1 "nn O B O A 2 1 X X. 1 and BB2 and BB X X= .3 2 n 3 n Xn X 1 Xx n X x 0...
CHAPTER 6 QUESTION 1 Which of these names follows the naming conventions for constants presented in this chapter? a. WeeksInYear b. Weeks_In_Year c. weeks_in_year d. WEEKS_IN_YEAR 1 points QUESTION 2 Which of the following data types can you not use to store the value 500? a. float b. char c. int d. double 1 points QUESTION 3 What values are in the vector named pressures after the following code is executed? vector pressures; pressures.push_back(32.4); pressures.push_back(33.5); pressures.insert(pressures.begin(), 34.2); int index =...
Question 1 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text The statements inside of a Python loop are known as the ____ of the loop. Select one: a. body b. expression c. counter d. block Question 2 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text The Python 3 program below prints the number 3. s = "Python3" print(s[len(s)]) Select one: True False Question 3 Not yet answered Marked out of 1.00 Not...
Question 1 2 pts The preprocessor executes after the compiler. False True Question 2 2 pts What code is human-readable and follows the standards of a programming language? Secret code Source code Key code None of these Machine code Question 3 2 pts What is the symbol that marks the beginning of a one line comment? Question 1 2 pts The preprocessor executes after the compiler. True False Question 5 2 pts A statement that may be used to stop...