2749 WordsMay 20, 201311 Pages

User | | Course | C++ Programming I | Test | Week 5 Midterm Exam | Started | 11/12/12 5:06 PM | Submitted | 11/13/12 10:28 PM | Status | Completed | Score | 64 out of 100 points | Time Elapsed | 2 hours, 0 minute out of 2 hours. | Instructions | The midterm exam consists of multiple choice questions. You will have 2 hours to complete it. Good Luck! |
Question 1
0 out of 2 points | | | Study the following code snippet: int greater_num(int num1, int num2)
{
if (num1 < 0 || num2 < 0)
{
cout << "Only POSITIVE Numbers!!!"; return 0;
}
else
{
if (num1 <= num2)
{
return num1;
}
else
{
return num2;
}
}
}
Which of the following describes a constraint on the use of this*…show more content…*

Which of the following is the best choice for the declaration of this function?Answer | | | | | Selected Answer: | double area(double w, double h) | Correct Answer: | double area(double w, double h) | | | | |
Question 12
2 out of 2 points | | | What is incorrect in the following code snippet? void display_box(string str)
{
cout << "--------" << endl; cout << str << endl; cout << "--------" << endl;
}
int main()
{
cout << display_box("Hello World"); return 0;
}Answer | | | | | Selected Answer: | display_box does not return a value; therefore, it cannot be used with cout <<. | Correct Answer: | display_box does not return a value; therefore, it cannot be used with cout <<. | | | | |
Question 13
2 out of 2 points | | | Which of the following variables is used to store a condition that can be either true or false?Answer | | | | | Selected Answer: | Boolean | Correct Answer: | Boolean | | | | |
Question 14
0 out of 2 points | | | Assuming that a user enters 5 as the age, what is the output of the following code snippet? int age = 0; cout << "Please enter your age: "; cin >> age; if (age < 10) { cout << "Kid" << endl; } if (age < 30) { cout << "Young" << endl; } if (age < 70) { cout << "Aged" <<

Related

## Varian Solution

153645 Words | 615 Pagesthat 1 of them is turned into a condominium. (a) Suppose that person A decides to buy the condominium. What will be the highest price at which the demand for apartments will equal the supply of apartments? What will be the lowest price? Enter your answers in column A, in the table. Then calculate the equilibrium prices of apartments if B, C, . . . , decide to buy the condominium. NAME 3 Person High price Low price A B C D E F G H 18 15 18 15 18 15 18 15

## _x000C_Introduction to Statistics and Data Analysis

355457 Words | 1422 Pages(Optional) 16-1 16.2 Distribution-Free Procedures for Inferences About a Difference Between Two Population or Treatment Means Using Paired Samples 16-10 16.3 Distribution-Free ANOVA 16-23 Appendix A: Statistical Tables 813 Appendix B: References 833 Answers to Selected Odd-Numbered Exercises 835 Index I-1 Sections and/or chapter numbers in color can be found at www.thomsonedu.com/statistics/peck Preface I n a nutshell, statistics is about understanding the role that variability plays in

### Varian Solution

153645 Words | 615 Pages### _x000C_Introduction to Statistics and Data Analysis

355457 Words | 1422 Pages