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
EastWind [94]
3 years ago
10

Determine the value for the following recursive method when x = 19.

Computers and Technology
1 answer:
Vedmedyk [2.9K]3 years ago
3 0

Answer:

f(19) = 2

Explanation:

Given

f(x) = f(x - 5)+ 2 --- x > 9

f(x) = -2 --- x \le 9

Required

Find f(19)

f(19) implies that: x = 19

Since 19 > 9, we make use of:

f(x) = f(x - 5)+ 2

f(19) = f(19 - 5) + 2

f(19) = f(14) + 2 ----- (1)

Calculate f(14)

f(14) implies that: x = 14

Since 14 > 9, we make use of:

f(x) = f(x - 5)+ 2

f(14) = f(14 - 5) + 2

f(14) = f(9) + 2 ------ (2)

Calculate f(9)

f(9) implies that: x = 14

Since 9 \le 9, we make use of:

f(x) = -2

f(9) = -2

So:

f(14) = f(9) + 2

f(14) = -2 + 2

f(14) = 0

f(19) = f(14) + 2

f(19) = 0 + 2

f(19) = 2

You might be interested in
I wiil mark brainlist ​
Darina [25.2K]
CAD is the answer you require, but it may also be Spread sheet

Hope this helped ♥︎
5 0
3 years ago
Which are the best examples of cost that should be considered when creating a project budget
sashaice [31]

Explanation:

how much the project will cost

5 0
3 years ago
Write a program that prompts the user for a word or phrase, and determines if the entry is a palindrome. A palindrome is a word
vekshin1

Answer:

Explanation:

The following code is written in Python. It asks the user for an input. Then cleans the input using regex to remove all commas, whitespace, and apostrophes as well as making it all lowercase. Then it reverses the phrase and saves it to a variable called reverse. Finally, it compares the two versions of the phrase, if they are equal it prints out that it is a palindrome, otherwise it prints that it is not a palindrome. The test case output can be seen in the attached picture below.

import re

phrase = input("Enter word or phrase: ")

phrase = re.sub("[,'\s]", '', phrase).lower()

reverse = phrase[::-1]

if phrase == reverse:

   print("This word/phrase is a palindrome")

else:

   print("This word/phrase is NOT a palindrome")

7 0
3 years ago
What are common tasks Human Services workers perform? Check all that apply.
Ainat [17]

Answer: B, D, E, F

Explanation:

I got I right.

7 0
3 years ago
Read 2 more answers
What is another term used for data dictionary?
Montano1993 [528]
About a database. A data dictionary defines the structure of the database itself (not that of the data held in the database) and is used in control and maintenance of large databases. Among other items of information, it records (1) what data is stored, (2) name, description, and characteristics of each data element, (3) types of relationships between data elements, (4) access rights and frequency of access. Also called system dictionary when used in the context of a system design

<span>Read more: http://www.businessdictionary.com/definition/data-dictionary.html</span>
4 0
3 years ago
Other questions:
  • To add text to a blank slide layout, _____.
    8·2 answers
  • P3. In Section 4.2 , we noted that the maximum queuing delay is (n–1)D if the switching fabric is n times faster than the input
    8·1 answer
  • Buying an existing business
    7·1 answer
  • When he takes a picture, Simon freezes an action without blurring it, to show movement. Which type of photographer is he?
    9·2 answers
  • For some reason, Danica's classmate George could not find the registered symbol in the symbol gallery. He is selling
    14·1 answer
  • Can a idler gear increase or decrease torque?
    7·1 answer
  • Describe how data is transmitted using half-duplex serial data transmission.
    9·1 answer
  • Why do many experts recommand longer time horizonal if you are doing high risk investment
    7·1 answer
  • 1.Which one of the following buttons returns a window to its original size?
    11·1 answer
  • 1. The supervisory software of a computer is called _____ (a) operating system (b) high – level language (c) transistor
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!