1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
podryga [215]
3 years ago
13

Consider the following method, which is intended to count the number of times the letter "A" appears in the string str.

Computers and Technology
1 answer:
sasho [114]3 years ago
7 0

The instruction that should replace /* missing code */ so that the method countA works as intended is (e)  str = str.substring(pos+1);

<h3>Methods</h3>

The program is an illustration of methods (or functions)

Methods are blocks of program statements that are executed when called or evoked

For the method to return the number of character A in a string, the loop body must check if the current character is A.

This is done using the substring method of a string

The syntax of this is: str.substring(pos + 1).

Where str represents the string, and pos + 1 represents the character index

Hence, the missing instruction is str = str.substring(pos+1);

Read more about methods at:

brainly.com/question/14284563

You might be interested in
wo non-negative integers x and y are equal if either: Both are 0, or x-1 and y-1 are equal Write a function named equals that re
Mrac [35]

Answer:

Using python programming language.

Explanation:

#to define the function write as below

def equal():

    #to get the two integers from the user

#The user is asked for input in the code below.

x = int(input("Enter the value for X"))

y= int(input("Enter the value for y"))

if x==0 and y==0:

    print("both numbers are ", "0")

elif: x==1 and y==1:  #This test if both x and y are 1

    print("true")

elif: x==y: #this line test if both values are equal

    print("true")

else:

    print("False")

equal()  #end of the function

3 0
3 years ago
.9 What is Artificial Intelligence?
Serhud [2]
C because bread is not happy with you
8 0
3 years ago
Write the pseudocode for a function named timesTen that accepts an Integer argument. When the function is called, it should retu
iren [92.7K]

Answer:

function timesTen (number):

   return number * 10

n = int(input("Enter an integer: "))

print(str(n) +"x10 is equal to: " + str(timesTen(n)))

Explanation:

Pseudocode is the representation of an algorithm. It shows the steps of the algorithm combination of the English and programming language.

In the pseudocode, we said we will be defining a function called timesTen that takes one parameter and returns the value of its parameter multiplied times 10.

In the main, we asked the user to enter a number. Then, we called the function with that number, and print the result.

3 0
3 years ago
Software which allows user to view the webpage is called as____
melisa1 [442]
“1. Website” is correct.
5 0
3 years ago
HELP!!!!!
xxMikexx [17]
Leave the room and let someone else figure it out!
5 0
3 years ago
Other questions:
  • Which of the following is a unique feature of Object-oriented programming?
    6·2 answers
  • Which term refers to the data stored in computer memory on which the processor applies to program instructions
    11·1 answer
  • In Microsoft Word you can access the _______ command from the "Mini toolbar." 
    9·1 answer
  • Assuming the Direct Hashing function and the Subtraction preprocessing algorithm is used to map keys into indices, give the inde
    15·1 answer
  • Grace is performing a penetration test against a client's network and would like to use a tool to assist in automatically execut
    13·2 answers
  • Which of the following questions will most likely be answered by displaying data on a line graph?
    11·1 answer
  • Which cable would you check if you can't access any web pages?
    12·1 answer
  • Molly, an end user, connects an external monitor, external keyboard and mouse, and a wired network cable to her laptop while wor
    12·1 answer
  • Does a 21.6v battery work with a 24 volt controller
    6·1 answer
  • READ CAREFULLY! There is a difference between moving and copying files.a. Create a directory named . For example, mine would be
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!