Misc 3 - If they contain just simple lines of code, use no...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
If they contain just simple lines of code, use no for loops or the like, C++ functions can be declared INLINE. This means their code will be inserted right everywhere the function is used. That's somehow like a macro. Main advantage is the program will be faster. A little drawback is it will be bigger, because the full code of the function was inserted everywhere it is used : #include <iostream.h> #include <math.h> inline double hypothenuse (double a, double b) { return sqrt (a * a + b * b); } void main () { double k = 6, m = 9; // Next two lines produce exactly the same code : cout << hypothenuse (k, m) << endl; cout << sqrt (k * k + m * m) << endl;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
} You know the classical structures of C : for, if, do, while, switch. .. C++ adds one more structure named EXCEPTION :
Background image of page 2
NPV = C0 + CSuccess (Prob. of Success) NPV = –$120,000 + $1,200,000 (0.70) NPV = $720,000 And the NPV of using the consulting firm is: NPV = C0 + CSuccess (Prob. of Success) NPV = –$400,000 + $1,200,000 (0.90) NPV = $680,000 The firm should conduct a focus group since that option has the highest NPV. 8. The company should analyze both options, and choose the option with the greatest NPV. So, if the company goes to market immediately, the NPV is: NPV = CSuccess (Prob. of Success) + CFailure (Prob. of Failure) NPV = $30,000,000(.55) + $3,000,000(.45) NPV = $17,850,000.00 Customer segment research requires a $1 million cash outlay. Choosing the research option will also delay the launch of the product by one year. Thus, the expected payoff is delayed by one year and must be discounted back to year 0. So, the NPV of the customer segment research is:
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
NPV= C0 + {[CSuccess (Prob. of Success)] + [CFailure (Prob. of Failure)]} / (1 + R ) t NPV = –$1,000,000 + {[$30,000,000 (0.70)] + [$3,000,000 (0.30)]} / 1.15 NPV = $18,043,478.26 Graphically, the decision tree for the project is: The company should undertake the market segment research since it has the largest NPV. Start Research No Research $18.0435 million at t = 0 $17.85 million at t = 0 Success Failure Success Failure $30 million at t = 1 ($26.087 million at t = 0) $3 million at t = 1 ($2.6087 million at t = 0)
Background image of page 4
$30 million at t = 0 $3 million at t = 0 Here, the appeal is to the moral sensibilities of non-Aboriginal peoples and the assumption is that with increased knowledge about the injustices placed upon First Nations peoples, non-Aboriginal people in B.C. will want to do what is morally right — to provide appropriate recompense. First Nation representatives
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/26/2012 for the course MBA IT DOM1 taught by Professor Kviswanathan during the Spring '12 term at Indian Institute of Technology, Chennai.

Page1 / 11

Misc 3 - If they contain just simple lines of code, use no...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online