Ask Computer Engineering Expert

1.The body of a while statement does not execute if the loop-continuation condition is false.

A) True
B) False
2.The setw parameterized stream manipulator sets the minimum field width in characters for the next value to be displayed.
A) True
B) False
3.A do...while loop will not execute if its loop continuation condition is false before the loop is started.
A) True
B) False
4.Sentinel-controlled repetition terminates when ________.
A) the application terminates
B) the sentinel value is encountered
C) the user enters -1
D) None of the above.
5.Assuming that variables value1 and value2 are both declared as ints,which of the following statements causes the result of the calculation to be truncated?
A)double result = static_cast(value1) / value2
B)double result = value2 + static_cast(value1)
C) double result = value1 / value2
D) All of the above.
6.Sentinel-controlled repetition is also called ________ repetition.
A) definite
B) indefinite
C) infinite
D) Both b and c.
7.Fatal logic errors __________.
A) are detected by the compiler.
B) cause the application to crash.
C) can be caused by division by zero.
D) Both b and c.
8.When a double containing the value 2.718 is cast to an int, the int will contain the value _______?
A) 2.7
B) 3
C) 2
D) a double can not be cast to an int.
9.When an int is divided by a double, the result is ___________.
A) a double value
B) an int value
C) a syntax error
D) a fatal logic error
10.The initial value of the control variable is one of the four essential elements of counter-controlled repetition.
A) True
B) False
11.In the for statement header, the expressions are separated by commas (,).
A) True
B) False
12.The following code varies the control variable in increments of 6 from 6 to 66: for ( int i = 6; i <= 66; i += 6 );
A) True
B) False
13.The pow function is declared in the math library, which is accessed by including the header file.
A) True
B) False
14.Which of the following is not a valid increment (or decrement) of the control variable in a for repetition statement header?
A) i*=10
B) i++
C) i+1
D) i-=1
15.In a for loop, the control variable is incremented (or decremented) _______?
A) after the body of the loop executes
B) before the body of the loop executes
C) while the loop-continuation condition is false
D) while the body of the loop executes
16.The for header ________ can be used to vary the control variable over the odd numbers between 1 and 10.
A) for (int i=1; i<=10; i+=1)
B) for (int i=1; i<=10; i+=2)
C) for (int i=1; i<=10; i-=1)
D) for (int i=1; i<=10; i-=2)
17.The body of the for loop with the header: for (int i=1; i<=10; i-=1) will be executed __________ times.
A) a very large number of 
B) 9
C) 10
D) 11
18.The ________ function returns the value of one number raised to the power of another number.
A) power
B) exponent
C) pow
D) exp
19.The body of a Do-While loop will always execute at least once, whereas the body of a For loop may never execute.
A) True
B) False
20.Which of the following is NOT a C++ looping control statement type?
A) while
B) for
C) do-while
D) switch
21.What is the value of 'sum' after execution of the following code? (All variables are of type 'int'.)
sum = 0; 
for (counter = 2; counter <= 5; counter++) 
{
sum = sum + (2 * counter); 
}
A) 28
B) 18
C) 10
D) 30
E) none of the above
22.A constant expression in a case label can be a character literal, an integer literal or a floating-point literal.
A) True
B) False
23.A switch statement will execute all statements after a matching case label until a break statement or the end of the switch statement.
A) True
B) False
24.The _______ signifies the end of a switch statement.
A) end keyword
B) } character
C) break keyword
D) default keyword
25._______ is a valid case label.
A) case: 'A'
B) case: "A"
C) case 'A':
D) case: 1
26.If the controlling expression in the switch statement is not equal to any of the case labels and there is no default case, _______.
A) an error occurs
B) an infinite loop occurs
C) the program continues execution with the next statement after the end of the switch
D) the first case's statements are executed
27._______ separates the case label from the code that will execute if the case label matches the controlling expression.
A) A colon
B) An underscore
C) The break keyword
D) A semicolon
28.The correct syntax for a default case is _______?
A) defalut case
B) default
C) default case:
D) default:
29.In C++, programmers break applications into smaller pieces using functions and classes.
A) True
B) False
30.A function name can be any valid identifier that is not reserved for use by C++.
A) True
B) False
31.When using the debugger, if the next statement to execute is a function call and the Step Into command is used, control is transferred to the called function.
A) True
B) False
32.A function definition is made up of _______.
A) a function header
B) a function body
C) a function name
D) All of the above.
33.How many values can a return statement return to a caller?
A) zero
B) one 
C) any number
D) Both a and b.
34.Which of the following statements correctly returns 'int' variable 'value' from a function?
A) return value();
B) return int value;
C) value return;
D) return value;
35.The first part of a function definition (including the return type, function name, and the parameter list) is known as the function _______.
A) body
B) title
C) caller
D) header
36.The _______ function from the cmath library find outs the square root of the double value passed as an argument.
A) squareRoot
B) root
C) sqrt
D) square
37.If a C++ function does not use parameters, you still must put parentheses around the empty parameter list.
A) True
B) False
38.Which of the following is NOT a reason why programmers prepare their own functions?
A) to help organize and clarify programs
B) to make programs execute faster than they would with sequential flow of control
C) to allow the reuse of the same code (function) within the same program
D) to allow the reuse of the same code (function) within another program
39.When parameters are passed between the calling code and the called function, the calling and the called parameters are matched by:
A) their data types
B) their relative positions in the calling and the called parameter lists
C) their names
D) whether they are inputs to or outputs from the function
40.Which of the following is the correct function 'heading' for a parameterless function named 'PrintStars'?
A) void PrintStars
B) void PrintStars;
C) void PrintStars( )
D) void PrintStars( );
E) void PrintStars (int n) 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M981386

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As