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
good information is characterized by certain properties. List and explain these characteristics of good information​
Gelneren [198K]

Answer:

here is your ans

Explanation:

Characteristics of good quality information can be defined as an acronym ACCURATE. These characteristics are interrelated; focus on one automatically leads to focus on other.

Accurate

Information should be fair and free from bias. It should not have any arithmetical and grammatical errors. Information comes directly or in written form likely to be more reliable than it comes from indirectly (from hands to hands) or verbally which can be later retracted.

Complete

Accuracy of information is just not enough. It should also be complete which means facts and figures should not be missing or concealed. Telling the truth but not wholly is of no use.

Cost-beneficial

Information should be analysed for its benefits against the cost of obtaining it. It business context, it is not worthwhile to spend money on information that even cannot recover its costs leading to loss each time that information is obtained. In other contexts, such as hospitals it would be useful to get information even it has no financial benefits due to the nature of the business and expectations of society from it.

User-targeted

Information should be communicated in the style, format, detail and complexity which address the needs of users of the information. Example senior managers need brief reports which enable them to understand the position and performance of the business at a glance, while operational managers need detailed information which enable them to make day to day decisions.

Relevant

Information should be communicated to the right person. It means person which has some control over decisions expected to come out from obtaining the information.

Authoritative

Information should come from reliable source. It depends on qualifications and experience and past performance of the person communicating the information.

Timely

Information should be communicated in time so that receiver of the information has enough time to decide appropriate actions based on the information received. Information which communicates details of the past events earlier in time is of less importance than recently issued information like newspapers. What is timely information depends on situation to situation. Selection of appropriate channel of communication is key skill to achieve.

Easy to Use

Information should be understandable to the users. Style, sentence structure and jargons should be used keeping the receiver in mind. If report is targeted to new-comer in the field, then it should explain technical jargons used in the report.

4 0
3 years ago
What is open source software? ​
lana [24]

Answer:

Open source software is free, modifiable, and is able to be redistributed. It is beneficial to those wanting  to customize the software to suit their purposes as it can be easily shared and redistributed.

6 0
3 years ago
Which tools can be used to scale an object? Check all that apply.
meriva

Answer:

format picture pane

corner sizing handles

Explanation:

7 0
3 years ago
Help me due and like 20 minutes help this is science!!
Murljashka [212]

Answer:

16pi or 50.24

Explanation:

The area of a circle is pi(r)^2, and since r = 4, then the area is pi * 4^2 which is 16pi.

8 0
3 years ago
The Fibonacci numbers are the numbers
Doss [256]

Answer:

function fibonacci(n):

  if n is equal to 1 or n is equal to 2:

       return 1

  else:

       return fibonacci(n-1) + fibonacci(n-2)

end of the function

Input the n

Print fibonacci(n)

Explanation:

* The above algorithm (pseudocode) is written considering Python.

Create a function called fibonacci that takes one parameter, n

If n is equal to 1 or 2, return 1 (When n is 1 or 2, the fibonacci numbers are 1)

Otherwise, return the sum of the two previous numbers (When n is not 1 or 2, the fibonacci number is equal to sum of the two previous numbers)

Ask the user for n

Call the function, pass n as a parameter and print the result

6 0
3 years ago
Other questions:
  • Can anyone help me with edhesive 4.2 Question 1 ???
    11·2 answers
  • What is unique about being an administrative professional in a government job?
    8·2 answers
  • Write a program using integers user_num and x as input, and output user_num divided by x three times. Ex: If the input is: 2000
    15·1 answer
  • Which of the following are common data types? Check all that apply.
    6·1 answer
  • If Digital Assistants are free to use why companies do spend millions of dollars to develop and support them?
    8·1 answer
  • How to change my age on this app
    10·2 answers
  • What are the objectives of the computer communication with the surrounding world? ​
    11·1 answer
  • Draw algorithm and flowchart of multiply A and B​
    10·1 answer
  • What is added to brining liquid to add flavour​
    6·1 answer
  • What type of attack occurs when the threat actor snoops and intercepts the digital data transmitted by the computer and resends
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!