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
kotegsom [21]
3 years ago
8

Write a recursive function num_eights that takes a positive integer pos and returns the number of times the digit 8 appears in p

os
Computers and Technology
1 answer:
nata0808 [166]3 years ago
7 0

Answer:

Explanation:

The following is written in Java. It creates the function num_eights and uses recursion to check how many times the digit 8 appears in the number passed as an argument. A test case has been created in the main method and the output can be seen in the image below highlighted in red.

  public static int num_eights(int pos){

       if (pos == 0)

           return 0;

       if (pos % 10 == 8)

           return 1 + num_eights(pos / 10);

       else

           return num_eights(pos / 10);

   }

You might be interested in
Refer to Table 8-4. Consider the data above (in billions of dollars) for an economy: Gross domestic product (in billions of doll
Whitepunk [10]

If one uses the data above (in billions of dollars), the Gross domestic product (in billions of dollars) for this economy equals  $1,200.

<h3>What is the GDP about?</h3>

Note that:

GDP (Gross Domestic Product):

Thus it will be :

Consumption + Investment + Government expenditure + (Export - Import)

Which is:

GDP = 800 + 200 + 300 + (100 - 200)

GDP = $1200 billions

See full question below

Consumption expenditures $800

Investment expenditures 200

Government purchases 300

Exports 100

Imports 200

Wages 800

8) Refer to Table above. Consider the data above (in billions of dollars) for an economy: Gross domestic product (in billions of dollars) for this economy equals

A) $2,200.

B) $1,600.

C) $1,400.

D) $1,200.

Learn more about GDP from

brainly.com/question/1383956

#SPJ1

6 0
2 years ago
How do you restore deleted notpad++ file?
Natasha2012 [34]
Check your trash can, if that doesnt work then I would say its lost.
3 0
3 years ago
4. True or False: In order to use wi-fi signal/network, you have to remain seated in one spot.
gizmo_the_mogwai [7]

Answer:

4. flase

5. true

Explanation:

If your getting wifi signal on your phone right now while where running in your house or traveling through the kitchen, you don't have to sit in one spot.

I tried doing that with another phone but It didn't work... :(

5 0
3 years ago
Where should citations be included in your research paper? Select all that apply.
yKpoI14uk [10]

Answer:

it would be the first one because it's the header and that's what applies

5 0
3 years ago
A(n) ________ is a group of senior managers from the major business functions that works with the chief information officer (CIO
Akimi4 [234]
Steering Committee.
7 0
3 years ago
Other questions:
  • The ___________________ Act makes it illegal to deactivate or otherwise disable any antipiracy technologies including DRM techno
    7·1 answer
  • Will a tablecloth that is 155 cm long cover a table that is 1.6 m long?
    12·2 answers
  • Using the _______ list, you can select the number of photos that will appear on each slide.
    13·1 answer
  • In addition to ranking the relevance of a particular site according to the keywords entered by the user, which of the following
    10·1 answer
  • Hi wanna play fortnite tomorrow add me im batjoker09 no caps or spaces
    13·1 answer
  • Hey should I get a r()blox gift card if so what amount 5 dollars 10 or 100
    14·1 answer
  • A user finished working on a computer in the lab. What should the user do so
    15·1 answer
  • Neview of related literature happens in two wayo (1) Traditional and
    6·1 answer
  • What is the extension of a Microsoft access database 2013​
    7·2 answers
  • Write the technical terms for the following statements: The repeated working capacity of computer.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!