Exam 2: Flow of Control
Exam 1: C++ Basics37 Questions
Exam 2: Flow of Control33 Questions
Exam 3: Function Basics30 Questions
Exam 4: Parameters and Overloading31 Questions
Exam 5: Arrays32 Questions
Exam 6: Structures and Classes37 Questions
Exam 7: Constructors and Other Tools32 Questions
Exam 8: Operator Overloading,friends,and References31 Questions
Exam 9: Strings37 Questions
Exam 10: Pointers and Dynamic Arrays29 Questions
Exam 11: Separate Compilation and Namespaces35 Questions
Exam 12: Streams and File IO43 Questions
Exam 13: Recursion40 Questions
Exam 14: Inheritance30 Questions
Exam 15: Polymorphism and Virtual Functions34 Questions
Exam 16: Templates27 Questions
Exam 17: Linked Data Structures30 Questions
Exam 18: Exception Handling29 Questions
Exam 19: Standard Template Library46 Questions
Exam 20: Patterns and Uml22 Questions
Select questions type
Write a program that reads in and sums the squares of positive integers until a value that 0 or less is read in.
(Essay)
4.8/5
(38)
Which of the following control structures requires curly braces?
(Multiple Choice)
4.9/5
(31)
For each of the following situations,tell which type loop (while,do-while,or for)would be best in that situation:
a)Reading a list of an unknown number of homework grades for a single student.
b)Summing a series such as 1 +1/2 +1/(22)+ 1/(23)+ … + 1/(28)
c)Testing a newly coded library function to see how it performs for different values of its arguments.
d)Reading in the number of days of vacation taken by an employee.
(Essay)
4.8/5
(41)
In a while loop,the Boolean_Expression is executed before each execution of the loop body.
(True/False)
4.7/5
(35)
Write Boolean expressions that represent the given English expressions.Assume any variables used have been declared and initialized.
a)alpha is greater than 1
b)x is odd
c)x and y are odd
d)ch is an upper case alphabetic character (between 'A' and 'Z').
e)digit,which is f type char,has value that is indeed a digit.
(Essay)
4.9/5
(32)
What is the output of the following,if it were embedded in an otherwise correct and complete program and run?
int x = 10;
While (x > 0)
{
cout << x << " ";
x= x + 3;
}
cout << endl;
(Multiple Choice)
4.8/5
(40)
Write the following do-while statement with a while construct,and maybe some extra code.
x = 10;
do
{
cout << x << endl;
x = x - 3;
} while ( x > 0 );
(Essay)
4.8/5
(39)
A numeric integer grade is between 50 and 99.Using integer division or otherwise obtain a int value that is 5,6,7,8,or 9 from the numeric grade.Write code using a switch statement using this number in the selector expression that assigns letter grades based on this 10 point scheme:
if the numeric_grade is not less than 90,the letter_grade is an A,
if the numeric_grade is not less than 80,the letter_grade is a B,
if the numeric_grade is not less than 70,the letter_grade is C,
if the numeric_grade is not less than 60,the letter_grade is D,
otherwise the letter_grade is F.
(Essay)
4.8/5
(29)
When a loop is nested in side another loop,a break or continue statement terminates or restarts the outermost loop of the nested loop structure.
(True/False)
4.9/5
(34)
The value of count is 0;limit is 10.Evaluate:
(count != 0)||(limit < 20)
(True/False)
4.8/5
(41)
Which of the following loop statements is guaranteed to iterate the body of the loop at least once?
(Multiple Choice)
4.9/5
(34)
Suppose we have these declarations,
int x = -1,y = 0,z = 1;
This Boolean expression is correct and it does what the programmer intends.
x < y < z
(True/False)
4.9/5
(39)
Showing 21 - 33 of 33
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)