exam3 - Doug Strait Chris Boyd Jacky Giang Title Main game...

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

View Full Document Right Arrow Icon
Doug Strait Chris Boyd Jacky Giang
Background image of page 1

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

View Full DocumentRight Arrow Icon
Title
Background image of page 2
10 kb 10 kb 10 kb 10 kb 20 kb 30 kb 20 kb 30 kb END 20 kb 30 kb 20 kb 30 kb Main game
Background image of page 3

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

View Full DocumentRight Arrow Icon
Strings – Dial-up   The literals used in cout statements  ( e.g. “hello”) are A – strings B- C++ strings C- C strings D- characters return;
Background image of page 4
Strings - DSL  #include<iostream>                                                                                    What does the program  output?  #include<string>  using namespace std;                                                                                  int main(){   string a("feet");   string b("ll");  string c("ick");  string d("eat");  string e("or");   string f("tr");   string g("sme");  string h("my");  string message;   message = f + c + " " + e + " " + f + d + " " + g + b + " " + h + " " + a << endl;   cout << message;   return 0;  }  return;
Background image of page 5

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

View Full DocumentRight Arrow Icon
Strings - Cable #include<iostream>                                                                                       What does the program output?  #include<string>  using namespace std;  void lookFor( const string & s, const string & pattern) {    if(s.npos == s.find(pattern)) {                                                                                                   cout << "There is no " << pattern << " in " << s << endl;}   else {    cout << " Found an " << pattern << " in " << s << endl;}  return; }  int main(){  string look = "money";  string pattern = "i";  string hey = "team";  string wow = "happiness";  lookFor( look, pattern);  lookFor( hey, pattern);  lookFor(look,wow);  return 0; } return;
Background image of page 6
Vectors – Dial-up Q: What will the condition return? vector <int> phoe; if(phoe.empty()) A: False. B: True. C: Condition is invalid. D: Only applies to strings. return;
Background image of page 7

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

View Full DocumentRight Arrow Icon
Vectors - DSL Q: What will the following program output? A: g  sandwiche B: sandwiches C:  g sandwiches   warmea D:  gwarwarwarwarwarwarwarmeasandwichessandwiche return;
Background image of page 8
Vectors - Cable Q: What will the following program output? A:  Brittle Peanut Brittle Peanut      Peanut Brittle Peanut Brittle      Brittle Peanut Brittle Peanut B: Same thing as D  but on one line. C: Segmentation fault. D: Brittle Peanut Peanut Peanut  Peanut Brittle Peanut Peanut       Peanut Peanut Brittle Peanut return;
Background image of page 9

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

View Full DocumentRight Arrow Icon
Sorting & Recursion – Dial- up Q: Which programming concept is critical for  terminating the chain of calls in a  recursive function?
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/16/2010 for the course ENGR 101 Sectio taught by Professor Ringenberg during the Fall '08 term at University of Michigan.

Page1 / 42

exam3 - Doug Strait Chris Boyd Jacky Giang Title Main game...

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

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