Question

Question 1 What is the value of x after the following int x = 5; x++;...

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:

  1. Void or Data Type
  2. the name
  3. optional parameter list

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.

}

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

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:

  1. Void or Data Type
  2. the name
  3. optional parameter list

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.

Add a comment
Know the answer?
Add Answer to:
Question 1 What is the value of x after the following int x = 5; x++;...
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
  • 1.   What will be the value of x after the following code is executed? int 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...

  • QUESTION 1 Which statement results in the value false? The value of count is 0; limit...

    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....

    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...

  • Quiz Question 1 (1 point) Saved The maximum value for an int is: Question 1 options:...

    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...

  • What will be the value of x after the following code is executed? int x =...

    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)...

  • QUESTION 1 What will be displayed as a result of executing the following code? int   x...

    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...

  • C++ Need the step count for this function. int binarySearch(const int array[], int size, int value)...

    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...

    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...

  • Question 31 In C, what is the computational result of 8/5*2.5? Question 32 Examine the for...

    Question 31 In C, what is the computational result of 8/5*2.5? Question 32 Examine the for statement given below. What is the most correct answer given below? for(degrees==0.0; degrees<=360.0; degrees+=20.0) ( ) Degrees must be in radians. ( ) Degrees must be capitalized. ( ) Cannot use double equal signs for assigning values to variables. ( ) Degrees cannot be incremented in the manner shown. Question 33 In a C program the formal and actual parameters that are used between...

  • QUESTION 1 Using the following declarations and a member of the Array class, int [ ]...

    QUESTION 1 Using the following declarations and a member of the Array class, int [ ] bArray = new int [10]; int location; Using a method in the Array class, write a statement that would change the order of the elements in the bArray array. The contents of the first cell should hold what was in the last cell. The second cell should hold what was in the next to last cell. __________________________ HINT: You must write the full statement...

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