What will the code cout << sentence produce?

```
1 string sentence = “C++ is my favorite programming language.”.;
2 string word; = “favorite”

3 int sentSize = sentence.size();
4 int wordSize = word.size();

5 int wordInSentence = sentence.find(word);
```

A. C++ is my favorite programming language.
B. true
C. sentence
D. Nothing. That’s not how you display strings.

A

Computer Science & Information Technology

You might also like to view...

_________ determine organizational goals and plan how to achieve those goals.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Analyze the following code.

``` public class Test { public static void main(String[] args) { System.out.println(max(1, 2)); } public static double max(int num1, double num2) { System.out.println("max(int, double) is invoked"); if (num1 > num2) return num1; else return num2; } public static double max(double num1, int num2) { System.out.println("max(double, int) is invoked"); if (num1 > num2) return num1; else return num2; } } ``` a. The program cannot compile because you cannot have the print statement in a non-void method. b. The program cannot compile because the compiler cannot determine which max method should be invoked. c. The program runs and prints 2 followed by "max(int, double)" is invoked. d. The program runs and prints 2 followed by "max(double, int)" is invoked. e. The program runs and prints "max(int, double) is invoked" followed by 2.

Computer Science & Information Technology