Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

Many high school students take the ap tests in different

Many high school students take the AP tests in different subject areas. In 2007, of the 144,796 students who took the biology exam 84,199 of them were female. In that same year, of the 211,693 students who took the calcu ...

Assume a normal distribution for n 300 how many cases

Assume a normal distribution for N = 300. How many cases would one expect to find between +1 and -1 standard deviations around the mean?

Question what is the smallest accurate big-oh notation for

Question : What is the smallest accurate big-Oh notation for finding an optimal tour for a travelling sales person problem on a graph with with V vertices (nodes) and E edges (arcs) ? (a) O(1) (b) O(V) (c) O(V log V) (d) ...

Question what are the risks of transmitting data over an

Question : What are the risks of transmitting data over an unsecured Wi-Fi network? What steps are necessary to secure Wi-Fi Protected Access Network? Distinguish between client/server and file server architecture. Is te ...

Take the input of numbers and reverse the order of elements

Take the input of numbers and reverse the order of elements in that vector using recursion.

Two contract offers are made to you the first contract

Two contract offers are made to you. The first contract offers $10,000 at the end of each year for the next five years and then $20,000 per year for the following 10 years. The second offer pays 10 payments, starting wit ...

Really needing some help with this assignmentto convert

Really needing some help with this assignment. To convert degrees Celsius to degrees Kelvin, we simply add 273 (°K= °C + 273). Prompt the user for a temperature in degrees Celsius, then convert that temperature to degree ...

Situation you are designing a system with a requirement to

Situation: You are designing a system with a requirement to provide direct access to 10,000 records. The data file grows at a rate of 5% per year. Evaluate the effect of a static hashed file with a load factor of .45. 1. ...

Please solve the following question using java format

please solve the following question using java format (*Solution can include*if needed* ( if statement, switch, while ) not arrays*) Write a program which performs the following: a) Prompts the user to enter a number N b ...

Hayley motorcycle company just paid a dividend of 14 today

Hayley Motorcycle Company just paid a dividend of $1.4 today, and is expected to pay a dividend in year 1 of $1.8, a dividend in year 2 of $2.3, a dividend in year 3 of $2.9, and a dividend in year 4 of $3.8. After year ...

  • 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