Reference no: EM131103655
Reference list of functions/syntax:
cout <<
cin >>
getline(cin, ...) static_cast<type> (...) some_string.length() some_string.substr(m) some_string.substr(m,n) some_string[i]
left, right
setw(n) set ll('[character]') setprecision(n)
xed if (...) { ... }
else if (...) { ... } else (...) { ... } while (...) { ... }
1. One-Liners (1 mark each) Place answer in the box. Generally no partial credit.
(a) Determine the truth of the following statement: (5 > 4) && ( (2 > 6) || !(0 > 1) )
(b) What is the value of i after the following loop? int i = 5; while( (i % 3) != 0) { i++ ;}
2. Short Answer
Consider the class declaration below for a class that stores numbers and returns the largest/smallest in the collection.class MaxMin
{public: // Create a new MaxMin object MaxMin();
// Add a double to MaxMin collection void include(double new_num);
// Return the largest number in collection double get_max() const;
// Return the smallest number in collection double get_min() const;
};
private:
// Stuff you don't need to worry about };
Write a few lines of code that will:
(a) Create a new MaxMin object called MM.
(b) Add the value 3.14 to the MM collection.
(c) After several items have been added, write a few lines that will output "Yes" if the smallest element is less than or equal to -7 and otherwise print "No".
Assume all necessary header less and supporting les are already included, you are in the standard namespace, your code appears somewhere inside the main routine, etc.
How much will your firms total revenues
: You are the manager of a firm that receives revenues of $20,000 per year from product X and $80,000 per year from product Y. The own price elasticity of demand for product X is -3, and the cross-price elasticity of demand between product Y and X is -..
|
Competition might reduce discrimination in the long run
: Males under the age of 25 must pay far higher auto insurance premiums than females in this age group. How does this fact relate to statistical discrimination? Statistical discrimination implies that discrimination can persist indefinitely, while the ..
|
Which food is the most likely vehicle of infection
: Using the data in the above line listing, complete the table below. Which food is the most likely vehicle of infection? What type of transmission is this (person-to-person, indirect vehicle-borne, airborne, indirect vector-borne, direct droplet sprea..
|
Discuss your overall fat intake and what types of fat
: How did your intakes compare to the ULs (diet and any supplements combined)? Discuss. how did your intakes compare to fiber and water recommendations? Discuss. discuss your overall fat intake and what types of fat predominate in your diet. how do you..
|
What is the value of i after the following loop
: Determine the truth of the following statement: (5 > 4) && ( (2 > 6) || !(0 > 1) ). What is the value of i after the following loop? int i = 5; while( (i % 3) != 0) { i++ ;}
|
What is the difference between gdp and gnp
: What is the difference between GDP & GNP?
|
Domestic investment remained the same
: if a country were to save more, but its domestic investment remained the same, then which of the following would rise
|
Motivations were behind increase in federal funds target
: What economic circumstances and motivations led to the end of quantitative easing? Be specific. What specific motivations were behind the increase in the federal funds target?
|
What is the required reserve ratio
: What is the required reserve ratio? if the fed increases the reserve requirement from your answer to part a to 10 percent, explain verbally and show numerically what will happen to:
|