Question 1
What is the value of x after the following
int x = 5;
x++;
x++;
x+=x++;
A)14
B)10
C)13
D)15
Question 2
The last line in value returning function (before the }) should
contain the word return.
True
False
Question 3
This contains three parts:
A)Menu System
B)Function Header
C)Switch
Question 4
What is a variable?
A)a pointer
B)a place in memory to hold data
C)int
D)a computer programming language
Question 5
What is the data type in the declaration:
double total;
A) it hasn't any data type assigned to it yet
B) you can't tell the data type from this declaration
C) total
D) double
E) int
Question 6
How many pieces of data can a variable hold at a given time?
A)two
B)infinite
C)it depends on the data type
D)none
E)one
Question 7
int a = 4, b = 9, c = 2,
Evaluate
c >= 2 && a < 5 || b < 8
True
False
Question 8
Arrays are passed by reference
True
False
Question 9
If (5 == 5 && 6 == 6 && 2 < 8 && 9 != 89)
A)No way of knowing
B)This will always be false
C)This will always be true
D)May be true or false
Question 10
If you pass a variable by VALUE to a function, the function cannot
change the value of the in the scope of the caller.
True
False
Question 11
Should be used with designing a menu driven program
A)Else and While Loop
B)Else if and Do While
C)Switch and For Loop
D)Switch and Do While
Question 12
Which is NOT a data type in Visual Studios 2017 C IDE
A)char
B)int
C)string
D)float
E)double
Question 13
if the sun comes out during the day and the moon comes out during the night
if cruise ships sail on the ocean
if Valencia has a pro football team
Answer is RED
else
Answer is WHITE
else
Answer is GREEN
else
Answer is BLUE
A)WHITE
B)RED
C)GREEN
D)BLUE
Question 14
void changeA(int array[ ]){
array[0]++;
}
void changeB(int a[ ]){
array[0]++;
}
void changeC(int array){
array[2]++;
}
main(){
int array[10] = {2};
changeA(array);
changeB(array);
changeC(array[0]);
// What is the value of array[0] at this line of the code. That number is stored in the array at element zero.
}
Question 1
What is the value of x after the following
int x = 5;
x++;
x++;
x+=x++;
A)14
B)10
C)13
D)15
Answer: 15
Explanation:
After x ++ => x = 6
After x ++ => x = 7
After x += x ++ => x = x + x++ = 7 + 8 = 15
Question 2
The last line in value returning function (before the }) should
contain the word return.
True
False
Answer: True
Explanation: Self explanatory
Question 3
This contains three parts:
A)Menu System
B)Function Header
C)Switch
Answer: B) Function Header
Explanation:
The general form of a C++ function definition is as follows −
return_type function_name( parameter list ) { body of the function }
Question 4
What is a variable?
A)a pointer
B)a place in memory to hold data
C)int
D)a computer programming language
Answer: B)a place in memory to hold data
Explanation: Self-explanatory
NOTE: As per Chegg policy, I am allowed to answer only 4 questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.
Question 1 What is the value of x after the following int x = 5; x++;...
1. What will be the value of x after the following code is executed? int x = 10, y = 20; while (y < 100) { x += y; } A. 90 B. 110 C. 210 D. This is an infinite loop 2. If a superclass has constructor(s): A. then its subclass must initialize the superclass fields (attributes). B. then its subclass must call one of the constructors that the superclass does have. C. then its subclass does not inherit...
Quiz Question 1 (1 point) Saved The maximum value for an int is: Question 1 options: 2147483647 65535 32767 9223372036854775804 Question 2 (1 point) A float has ____ decimal places of accuracy. Question 2 options: 15 none 7 3 Question 3 (1 point) It is a good practice to compare floats and doubles with ==. Question 3 options: True False Question 4 (1 point) Strings are reference data types. Question 4 options: True False Question 5 (1 point) Value data...
QUESTION 1 Which statement results in the value false? The value of count is 0; limit is 10. (count != 0)&&(limit < 20) (count == 0)&&(limit < 20) (count != 0)||(limit < 20) (count == 0)&&(limit < 20) 10 points QUESTION 2 If this code fragment were executed in an otherwise correct and complete program, what would the output be? int a = 3, b = 2, c = 5 if (a > b) a = 4; if (...
25. Given the array declaration double xyz [20]: which of the following statements are true? a. The array may hold up to 20 elements which may be accessed by the subscripts 0 through 20 b. The array may hold up to 21 elements which may be accessed by the subscripts 0 through 20 c. The array may hold up to 21 elements which may be accessed by the subscripts 0 through 19 d. The array may hold up to 20...
QUESTION 1 What will be displayed as a result of executing the following code? int x = 5, y = 20; x += 32; y /= 4; cout <<"x = " << x <<"y = " << y; A. x = 32, y = 4 B. x = 9, y = 52 C. x = 37, y = 5 D. x = 160, y = 80 8 points QUESTION 2 What will be the displayed when the following code...
What will be the value of x after the following code is executed? int x = 5; while (x <50) { x += 5; } a) 50 b) 45 c) Infiniteloop d) 55 Given the following code segment: Scanner in = new Scanner (System.in); boolean done = false; while (!done) { int input = in.next(); if(input.equalsIgnoreCase("q")) done = false; } What will cause the loop to terminate? a) When the user enters -1 b) The loop will never terminate c)...
HTML ASSIGNMENT Question 1: What is the value of the variable age after the following JavaScript statements are executed? var age = 30; age = " age is: " + age + 5; A. age is 30 B. age is + age + 5 C. age is 305 D. age is 35 Question 2: Assume there is an external JS file named "addContent.js". This file is located in the same folder as the HTML document "addContent.html". In order to make...
C++ Need the step count for this function. int binarySearch(const int array[], int size, int value) { int first = 0, last = size − 1, middle, position = −1; bool found = false; while (!found && first <= last) { middle = (first + last) / 2; if (array[middle] == value) { found = true; position = middle; } else if (array[middle] > value) last = middle − 1; else first = middle + 1; } return position; }
program. 13. What's the output of the following program? #include< iostream> #include&math> using namespace std; int p 7; void main) extern double var int p abs(-90); system( "pause"); double var = 55; 14. How many times does "#" print? forlint i 0;j< 10; +ti) if(i-2141 6) continue; cout<< "#"; 15. Write the function declaration/prototype for a, pow function b floor function 16. State True or False a. b. c. d. e. isupper function returns a double value for loop is...
1) int value = 24; int divisor = 5; value % divisor is a) 4 b) 1 c) 3 d) 0 e) 2 2) int value = 45; int divisor = 4; What is the result of value / divisor? a) 12 b) 11.25 c) 11 d) 10 3) Assume: int x[][] = {{ 1, 2 }, { 3, 4, 5 }, { 4, 5, 4, 9 }}; What are the values of? x.length? x[ 0 ].length? x[ 1 ].length?...