Computers and Technology
Computers and Technology, 21.05.2020 07:03, rcbs5310

Consider the following method:

public int countPs(String word)
{
int sum = 0;
for(int i = 0; i < word. length(); i++)
{
word = word. toLowerCase();
if(word. substring(i, i+1).equals("p"))
{
sum++;
}
}
return sum;
}

What would the value of sum be after the method call countPs("Peter Piper picked a pack of pickled peppers")?

7

9

2

0

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 09:00, mimithurmond03
Which is the highest level of the hierarchy of needs model? a. humanity b. intrapersonal c. team d. interpersonal
Answers: 1
image
Computers and Technology, 23.06.2019 12:00, anamatiascamaja
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
image
Computers and Technology, 23.06.2019 13:00, alexacarillo
In excel - calculate the actual increase/decrease from first quarter to the second quarter then subtract subtract first quarter value from second quarter total then divide result by first quarter value
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, mirmir62
Which of the following is not an enhancement to the standard wiki to make it more attractive for corporations? encryptionwork spacespermission toolspredictive text
Answers: 2
Do you know the correct answer?
Consider the following method:

public int countPs(String word)
{
int sum = 0...

Questions in other subjects: