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
I need ideas for a scratch (imagine, share, and program) coding project. You can think of any project you'd like thanks! :)
alex41 [277]

You did not include enough information.

5 0
3 years ago
Read 2 more answers
What are the components that make a computer work?
Schach [20]

Answer: Plastic, metal, rubber, wiring, electricity, technology, wifi,  

Explanation: You need  PLASTIC to make a frame for the computer. METAL

to make an exoskeleton under the plastic frame. RUBBER to hold those loose wires and to make sure the electricity doesn't escape and shock you. ELECTRICITY to charge and make the computer runs.  Technology is used for you to log in and out of your computer and WIFI to make sure it doesn't lag.

8 0
3 years ago
What will be a fundamental aspect of future games?
padilas [110]
D. product- oriented :))
6 0
3 years ago
Read 2 more answers
You can increase your efficiency by using your e-mail program's spell checker because it eliminates the need for you to proofrea
galina1969 [7]
The answer is True bc it saves you time and is efficient
6 0
3 years ago
Epic is fuzzy-figure8
prohojiy [21]

Answer:

Mine is Chachee_girl if u wanna play

8 0
2 years ago
Read 2 more answers
Other questions:
  • Yahoo! allows users to create personalized my yahoo! pages. users can add or delete a variety of information from their personal
    8·2 answers
  • What is the unique impact him professionals have on coded data?
    11·1 answer
  • What is a independent variable
    11·1 answer
  • A lamp outside a front door comes on automatically when it is dark, and when someone stands on the doormat outside the front doo
    7·1 answer
  • Hulu suggestions? I just got it and I wanna know what's good :)
    5·2 answers
  • What layer in the Transmission Control Protocol/Internet Protocol (TCP/IP) model is responsible for defining a way to interpret
    11·1 answer
  • How have productivity programs improved the professional lives of people? (check all that apply)
    8·2 answers
  • The help desk received a call from a user who cannot get any print jobs to print on the locally shared printer. While questionin
    8·1 answer
  • Given the function F (X, Y , Z)=Σm(0,1, 2 , 4 , 6)
    13·1 answer
  • When a hoverboard's battery dies, does the hoverboard battery life get impacted the next time the battery is full?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!