the fibonacci sequence begins with 0 and then 1 follows. all subsequent values are the sum of the previous two, for example: 0, 1, 1, 2, 3, 5, 8, 13. c

Answers

Answer 1

The nth term in the Fibonacci series is printed at the conclusion of the program.

What is a Fibonacci sequence?The Fibonacci numbers, also known as Fₙ, are a set of numbers in mathematics where each number is the sum of the two numbers before it. Although some authors omit the initial terms and begin the sequence from 1 and 1 or from 1 and 2, the sequence typically starts from 0 and 1.

So, until a condition is satisfied, recursions involve calling a function from within a function.

The necessary function, which uses comments to describe each line, is as follows:

//This defines the function

public static int fibonacci(int n) {

//The function returns -1, if n is negative

if(n<0){

return -1;}

//The function returns the value of n, if n is 0 or 1

if(n==0||n==1){

return n;}

//If otherwise

else{

//The function returns the nth term of the Fibonacci series

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

}

}

Therefore, the nth term in the Fibonacci series is printed at the conclusion of the program.

Know more about the Fibonacci sequence here:

https://brainly.com/question/16934596

#SPJ9

The correct question is given below:

The Fibonacci sequence begins with 0 and then 1 follows. All subsequent values are the sum of the previous two, for example: 0, 1, 1, 2, 3, 5, 8, 13. Complete the fibonacci() method, which takes in an index, n, and returns the nth value in the sequence. Any negative index values should return -1.

Ex: If the input is: 7

the out put is :fibonacci(7) is 13

Note: Use recursion and DO NOT use any loops. // is this mean i don't have to use loops? for (int i = 1; i<= n; ++i)

import java.util.Scanner;

public class LabProgram {

public static int fibonacci(int n) {

/* Type your code here. */

public static void main(String[] args) {

Scanner scnr = new Scanner(System.in);

int startNum;

System.out.println("Enter your number: ");

startNum = scnr.nextInt();

System.out.println("fibonnaci(" + startNum + ") is " + fibonacci(startNum));

}

}


Related Questions

A line has a slope of 1/3 and includes the points (6,1) and (9,j). What is the value of j?

Answers

WE WILL USE THE FORMULA OF CALCULATING GRADIENT

[tex]m = \frac{y2 - y1}{x2 - x1} \\ m = \frac{j - 1}{9 - 6} \\ \frac{1}{3} = \frac{j - 1}{3} [/tex]

I WILL USE CROSS MULTIPLICATION

[tex]3(j - 1) = 3 \\ \frac{3(j - 1)}{3} = \frac{3}{3} \\ j - 1 = 1 \\ j = 1 + 1 \\ j = 2[/tex]

ATTACHED IS THE SOLUTION

BE ALERT I INSERTED THE KNOWN VALUES IN THE FORMULA OF FINDING THE GRADIENT.

Simplify 9 3 × 9 2 × 9 4 leaving your answer in index form.

Answers

Answer:

804,264

Step-by-step explanation:

Evaluate 93×92×94

We have 1 of the number 93

We have 1 of the number 92

We have 1 of the number 94

Group numbers by powers:

93×92×94 = 93[1]92[1]94[1]

93[1]92[1]94[1] = 804,264

I have been struggling with this question for the past couple minutes I believe I have the formula correct, but it isn't working

Answers

Answer:

382.5 in^2

Explanation in attachment. Hope it helps! :)

i need help on these​

Answers

Answer:

read below

Step-by-step explanation:

1. $4, five granola bars cost $20. $20/5 = $4

2. 40 miles per hour, travels 100 miles at a constant speed for 40 miles. 100/2.5 = 40 miles

3. 12.5 situps per minute, 50 situps in 4 minutes. 50/4 = 12.5

4. $1.43 per one ounce, 3 ounces cost $4.29. 4.29/3 = $1.43

Avani and her children went into a grocery store and will buy peaches and mangos.
Each peach costs $0.75 and each mango costs $1.75. Avani has a total of $15 to spend
on peaches and mangos. Write an inequality that would represent the possible values
for the number of peaches purchased, p, and the number of mangos purchased, m.

Answers

The inequality which represents the possible values for the number of peaches and mangos purchased will be;

⇒ $0.75p + $1.75m = $15

What is Inequality?

A relation by which we can compare two or more mathematical expression is called an inequality.

Given that;

Avni and her children went into a grocery store and will buy peaches and mangos.

Each peach costs $0.75 and each mango costs $1.75.

And, Avni has a total of $15 to spend on peaches and mangos.

Now,

Let number of peaches purchased = p

And, Number of Mangos purchased = m

Since, Each peach costs $0.75.

Hence, Total cost of peaches purchased = $0.75p

And, Each mango costs $1.75.

Hence, Total cost of mangos purchased = $1.75m

Since, Avani has a total of $15 to spend on peaches and mangos.

So, An inequality that would represent the possible values of peaches and mangos will be;

⇒ $0.75p + $1.75m = $15

Thus, The inequality which represents the possible values for the number of peaches and mangos purchased will be;

⇒ $0.75p + $1.75m = $15

Learn more about the inequality visit:

https://brainly.com/question/24966055

#SPJ1

Guadalupe quiere saber la longitud de un túnel construido a través de una montaña. Para ello, ella toma las medidas indicadas en la figura a continuación. Utilizar estas medidas para hallar la longitud del túnel.

Llevar a cabo los cálculos intermedios usando al menos cuatro posiciones decimales.
Redondear la respuesta a la décima de metro más cercana.

Answers

247.1 m

Puedes usar la Ley de los Cosenos.

Explicación:

A line is drawn through (-7, 11) and (8,-9). The equation
y-11 = -4/3(x + 7) is written to represent the line. Which
equations also represent the line? Check all that apply.

Answers

Answer:

[tex]\textsf{Slope-intercept form}: \quad y=-\dfrac{4}{3}x+\dfrac{5}{3}[/tex]

[tex]\textsf{Standard form}: \quad 4x+3y=5[/tex]

Step-by-step explanation:

Given linear equation:

[tex]y-11=-\dfrac{4}{3}(x+7)[/tex]

The given linear equation is point-slope form.

[tex]\boxed{\begin{minipage}{3.7cm}\underline{Slope-intercept form}\\\\$y=mx+b$\\\\where $m$ is the slope\\ and $b$ is the $y$-intercept.\\\end{minipage}}[/tex]

To write the equation in slope-intercept form, isolate y:

[tex]\implies y-11=-\dfrac{4}{3}(x+7)[/tex]

[tex]\implies y-11=-\dfrac{4}{3}x-\dfrac{28}{3}[/tex]

[tex]\implies y-11+11=-\dfrac{4}{3}x-\dfrac{28}{3}+11[/tex]

[tex]\implies y=-\dfrac{4}{3}x+\dfrac{5}{3}[/tex]

[tex]\boxed{\begin{minipage}{5.4 cm}\underline{Standard form}\\\\$Ax+By=C$\\\\where $A, B$ and $C$ are constants and $A$ must be positive.\\\end{minipage}}[/tex]

To write the equation in standard form, eliminate the fraction, bring the terms in x and y to the left of the equation, and the constants to the right:

[tex]\implies y-11=-\dfrac{4}{3}(x+7)[/tex]

[tex]\implies (y-11) \cdot 3=-\dfrac{4}{3}(x+7) \cdot 3[/tex]

[tex]\implies 3y-33=-4(x+7)[/tex]

[tex]\implies 3y-33=-4x-28[/tex]

[tex]\implies 3y-33+4x=-4x-28+4x[/tex]

[tex]\implies 3y-33+4x=-28[/tex]

[tex]\implies 3y-33+4x+33=-28+33[/tex]

[tex]\implies 4x+3y=5[/tex]

Carol has 1\frac{5}{8} cups of yogurt to make smoothies. Each smoothie uses \frac{1}{3} cup of yogurt.

What is the maximum number of smoothies that Carol can make with yogurt?

Answers

Carol can make a maximum of 4 smoothies with the available yoghurt

Cups of yoghurt Carol has for making smoothies = 1 5/8 cups

Yoghurt Carol has in improper fractions = 13/8 cups

Cup of yoghurt used to make smoothie = 1/3 cups

Fractions: A numerical value that designates a portion of a whole is used to represent fractions. A fraction is a component or section taken from a whole, which can be any number, a certain amount, or an object.

Number of smoothies Carol can make = Total available yoghurt with Carol/Yoghurt used to make a smoothie

= (13/8)/(1/3)

= 39/8

Converting the fraction into a mixed fraction we get: 4 7/8 smoothies

So, she can make 4 cups of smoothie

Learn more about fractions:

https://brainly.com/question/1301963

#SPJ1

how do I write this ?

Answers

Answer:

1: -⅔

2: -⅓

Step-by-step explanation:

You plug the number into the Equation.

1:

2 = 3x + 4

-2 = 3x

x = -⅔

2:

3 = 3x + 4

-1 = 3x

x = -⅓

DO,K = (9, 6) (3, 2) The scale factor is___ 1/3 6 3

Answers

Based on the dilation, the scale factor of dilation of the point is 1/3

What is dilation?

Dilation involves enlarging or reducing the side length of a shape to create another shape by a constant scale factor, where the scale factor does not equal one.

How to determine the scale factor of dilation?

From the question, we have the following parameters

Dilation rule: Do,k

Point = (9, 6)

Image = (3, 2)

As a general rule of dilation, the following are the properties of a scaled copy of another figure

If the scale factor is greater than 1, the side lengths would be greater than the original figureIf the scale factor is less than 1, the side lengths would be less than the original figureThe side lengths may or may not be whole numbers

Using the above as a guide, the scaled factor is calculated as

Scaled factor = Image/Poins

This gives

Scaled factor, k = (3, 2)/(9, 6)

This gives

Scaled factor, k = 1/3

Hence, the scale factor is 1/3

Read more about scaled copy at

https://brainly.com/question/12516046

#SPJ1

A number, c, rounded to 1 d.p. is 47.3
Another number, d, rounded to 1 d.p. is 4.6
What are the lower and upper bounds of c- d?

Answers

The lower and upper bounds of c- d are 42.0 and 43.0 respectively.

What is termed as the rounding off?Rounding off merely refers to an estimate. Rounding off is the process of estimating this same actual number to a nearby number.Examine this same unit place digit:If indeed the unit place digit is a little less than 5, keep a tens place digit unchanged and replace it with 0.Whereas if unit place is 5 or greater, replace the tens digit with its successor and place 0 just at unit place.

For the given question;

A number, c, rounded to 1 decimal place is 47.3

Another number, d, rounded to 1 decimal place is 4.6

c- d = 47.3 - 4.6

c- d = 42.7

Lower bound = 42.0

Upper bound = 43.0.

Thus, the lower and upper bounds of c- d are 42.0 and 43.0 respectively.

To know more about the rounding off, here

https://brainly.com/question/27207159

#SPJ10

What is the equation of a line that contains the points (5, 0) and (5,-2)?
Ox=5
Ox=0
Oy=0
Oy=5

Answers

Answer:

x=5

you're welcome

A circular pond has a diameter of 15 feet which expression can be used to find the circumference in feet 

Answers

The expression used for finding the circumference of the circular pond is; C = 2π(d/2) feet.

What is defined as the circumference?The circumference of the circle, also known as the perimeter of the circle, is the measurement of the circle's boundary. The area of a circle, on the other hand, defines the region it occupies. If we expand a circle and draw a straight line through it, the length of the line is the circumference. It is typically measured in units such as centimeters or meters.

For the given question;

Let 'd' be the diameter of the circular pond.

The diameter of the pond  = 15 feet.

Let 'C' be the circumference of the circle;

The, the formula for finding the circumference of the circle is;

C = 2π(d/2) feet

For, d = 15 feet

C = 2π(15/2) feet

Take π = 3.14

C = 2×3.14×(15/2) feet

C = 47.1 feet

Thus, the circumference of the circular pond is found as 47.1 feet.

To know more about the circumference, here

https://brainly.com/question/18571680

#SPJ10

When an integer is subtracted from 2 times the next consecutive odd integer, the difference is 9. Find the value of the greater integer.

Answers

The integer is 5 and the next consecutive odd integer will be 7.

What is Algebraic expression ?

Algebraic expressions are the idea of expressing numbers using letters or alphabets without specifying their actual values. The basics of algebra taught us how to express an unknown value using letters such as x, y, z, etc. These letters are called here as variables. An algebraic expression can be a combination of both variables and constants. Any value that is placed before and multiplied by a variable is a coefficient.

let the integer be x

then, next consecutive odd integer will be x + 2

Now, according to the question :

integer is subtracted from 2 times the next consecutive odd integeb the difference is 9 means :

2(x+2) - x = 9

2x+ 4-x = 9

x + 4 = 9

x = 5

Therefore, The integer is 5 and the next consecutive odd integer will be 7.

Read more about equations at :

https://brainly.com/question/12895249

#SPJ1

find the lcm of the numbers 3,6,16 using lists of multiples

Answers

Answer:

48

Step-by-step explanation:

3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48

6 12 18 24 30 36 40 48

16 32 48

If GI and JL are parallel lines and mZJKH = 70°, what is m<LKM

​WILL GIVE BRAINLIEST

Answers

Answer:

70°

Step-by-step explanation:

Since m∠JKH and m∠LKM are verticle angles, they are equal to each other.

What is the radius of a circle with a circumference of 26 69 centimeters

Answers

Answer: Diameter is given is 26 cm then radius will be =r=D/2=26/2=13cm.

Step-by-step explanation: How do I find the radius from the circumference?1Divide the circumference by π, or 3.14 for an estimation. The result is the circle's diameter.2Divide the diameter by 2.3There you go, you found the circle's radius.

Suppose the domain of f is ( -1, 1).
Define the fucnction g by g(x)=f([tex]\frac{x+1}{x-1}[/tex]).

What is the domain of g?

Answers

If the domain of f is ( -1, 1), then the function g defined by g(x) = f((x + 1)/(x - 1)) has a domain of; (-2, 0)

What is the domain of the function?

The domain of a function refers to the set of all possible intput values that make the function possible.

Now, we are given the function;

g(x) = f((x + 1)/(x - 1))

The domain would be a set of real numbers excluding 1 because at x = 1, the function is undefined.

Since the domain of  f(x)  is  -1 < x < 1  ,

Then the domain of  f(x + 1)  is  -1 < x + 1 < 1 .

domain of -1 < x + 1 < 1  will simplify to -2 < x < 0

Thus, we can say that the domain of  f(x + 1)  is  (-2, 0).

Thus;

g(x) = f(x + 1) and as such, the domain of  g(x)  is  (-2, 0) .

Read more about Domain of function at; https://brainly.com/question/2264373

#SPJ1

Given the function, [tex]f(x)=-2x-1[/tex] express the value of [tex]\frac{f(x+h)-f(x)}{h}[/tex] in simplest form.

Answers

Value of the function [ f(x+ h) - f(x) ] /h in simplest form when f(x) = -2x -1 is equal to -2.

As given,

Given function:

f(x) = -2x -1

Express value of  in simplest form:

f( x + h ) = -2 (x + h ) - 1

             = -2x -2h -1                   ___(1)

Simplify the function by substituting value of f(x +h and f(x),

[f(x + h) - f(x) ] /h

= [ (-2x -2h -1 )- ( -2x -1 ) ] /h

= ( -2x -2h -1 +2x +1 ) /h

= -2h /h

= -2

Therefore, value of the function [ f(x+ h) - f(x) ] /h in simplest form when f(x) = -2x -1 is equal to -2.

Learn more about function here

brainly.com/question/12431044

#SPJ1

A car traveled at a constant speed. The graph shows how far the car traveled, in miles, during a given amount of time, in hours.

The point is on the graph. Explain what this means in terms of the car.
Is the point on this graph? Explain how you know.\

Answers

The point (1, 60). on the graph how's the speed that the car travels.

How to illustrate the value?

It should be noted that car traveled at a constant speed. The distance traveled is 210 miles and the time to travel is 3.5 hours.

Therefore, it should be noted that the point (3.5, 120) shows the distance.

The slope of the like which is the speed will be:

= Distance / Time

= 210 / 3.5

= 60 mph

Therefore, it should be noted that the point B(1, 60) lies on the graph.

Learn more about graph on:

brainly.com/question/18096419

#SPJ1

Select the correct answer. which situation is best met through long-term saving? a. a broken refrigerator b. retirement c. an unexpected car repair d. an unexpected medical bill

Answers

The situation best met through long term saving is retirement (Option B).

In many cases, the retirement fund is taken out of the paychecks at your job and is accumulated over years of your service and job till retirement, it is a long-term saving.

The purpose of long-term saving is the type of saving for long term financial goals. The other options are not long-term financial goals rather unexpected expenses. Hence, a situation best fulfilled through long term saving is retirement.

There are several long-term saving accounts use to save for long term financial goals such as retirement, buying a house, children’s education, or similar one-time, long-term expenses.

Hence, the correct answer is retirement – Option B

Learn more about Long-term saving:

https://brainly.com/question/3729664

#SPJ4

algebra vocabulary question

Answers

Answer:

We would describe 7x - 3 > 24 as an inequality

Step-by-step explanation:

The definition of inequality is a relationship between two expressions using  one of these inequality symbols:

greater than symbol (>), less than symbol (<), greater than or equal to symbol (≥), less than or equal to symbol (≤), and not equal to symbol (≠).

Answer:

Inequality

Step-by-step explanation:

Inequalities are never equal just like the question you have

An investor has $75,000 to invest in a CD and a mutual fund. The CD yields 6% and the mutual fund yields 7%.
The mutual fund requires a minimum investment of $10,000, and the investor requires that at least twice as much
should be invested in CDs as in the mutual fund. How much should be invested in CDs and how much in the
mutual fund to maximize the return? What is the maximum return?

Answers

The investment in cd would be $50000. the investment in mutual funds would be $ 25000. The maximum return is $5000.
What is inequality?
Inequality is defined as the relation which makes a non-equal comparison between two given functions.
Let x be the investment in CD
Let y be in mutual fund
Given;
Return = 6% x + 8% y
Return = 0.06 x + 0.08 y
The equation form;

we have a critical number as
(16000, 8000) :
return = 0.06 (16000 + 0.08 (8000) = $1600
(50000, 25000) :
return = 0.06 (50000) + 0.08 (25000) = $5000
(67000, 8000)
return = 0.06 (67000) + 0.08(8000) = $4660
As we can see the maximum benefit is $5000 so;
The investment in cd = x = $50000
The investment in mutual funds = $ 25000
The maximum return = $5000

please helpp i am very confused on finding the answer

Answers

Answer:

C. Lines l and m appear to be skew--they are not parallel, and they are not intersecting each other.

Which graph represents the solution to the inequality 2(b + 2) ≥ 24?

number line with open point at 10 with arrow pointing left
number line with closed point at 10 with arrow pointing left
number line with closed point at 10 with arrow pointing right
number line with open point at 10 with arrow pointing right

Answers

The graph that represents the solution to inequality 2(b + 2) ≥ 24 is given by the statement "number line with closed point at 10 with arrow pointing right" .

In the question ,

the inequality is given as

2(b + 2) ≥ 24

Solving the inequality further , we get

2b + 2*2 ≥ 24

2b + 4 ≥ 24

Simplifying further we get

2b ≥ 24-4

2b ≥ 20

b ≥ 10 .

Since the inequality has equal to sign, hence number line representing the inequality will have a closed point 10 ,

And on number line as the number increases the value move towards right ,

hence the arrow will point Right .

Therefore , the graph that represents the solution to inequality 2(b + 2) ≥ 24 is given by the statement "number line with closed point at 10 with arrow pointing right" .

Learn more about Inequality here

https://brainly.com/question/14875221

#SPJ1

Answer: C number line with closed point at 10 with arrow pointing right

Step-by-step explanation:

I took the test and I got it right. :)

hope this helps

What is the slope of a line that goes through the points (1,-5) and (-3, 2)?
O
O
O
7
4
3
3

Answers

Answer:

[tex]\sf -\dfrac{7}{4}[/tex]

Step-by-step explanation:

Finding the slope of a line:

  (1, -5)    ⇒ x₁ = 1    ; y₁ = -5

  (-3, 2)  ⇒ x₂ = -3  ; y₂ = 2

[tex]\sf \boxed{\bf Slope = \dfrac{y_2-y_1}{x_2-x_1}}[/tex]

            [tex]\sf =\dfrac{2-[-5]}{-3-1}\\\\= \dfrac{2+5}{-4}\\\\=\dfrac{7}{-4}\\\\= -\dfrac{7}{4}[/tex]

the 5ft tall person casts a shadow that is 4 ft long. how tall is the flagpole if it 28 foot shadow?

Answers

The flagpole is 35ft tall.

How to find the shadow's height?

Given,

A 5ft tall person casts a shadow that is 4 ft long.

Flagpole has a 28-foot shadow.

Solution:

Let x be the height of the flagpole.

5/x = 4/28

x = 35ft

The flagpole is 35ft tall.

To learn more about heights, refer

https://brainly.com/question/12446886

#SPJ13

Write each number as a polynomial and then simplify the sum or difference

Answers

Answer:

[tex]90a+10b[/tex]

Step-by-step explanation:

[tex](100a+10b+c)-(10a+c) \\ \\ =100a+10b+c-10a-c \\ \\ =90a+10b[/tex]

Mr. Lopez travels a distance of 100 miles to work each day, Which of the following graphs best represents the
relationship between the time Mr. Lopez takes to get to
work and the speed at which he drives?

Answers

Answer:

Step-by-step explanation:

they left at 12:34

simplify 2(x - 4) + 9

Answers

Answer: 2x + 1

Step-by-step explanation:

We will simplify this expression down to it's lowest terms.

      Given:

2(x - 4) + 9

      Distribute:

2x - 8 + 9

      Combine like terms:

2x + 1

Simplified Answer is:
2x+1


Other Questions
Approximately 90-95% of all cases of diabetes are classified as type 2. Type 2 diabetes is believed to be due to lifestyle factors and what?. distributive property 4x9.4 Anne reports that after the news is reported about Italy capitulating in the war, the Dutch radio program plays God Save the King (the British national anthem), the American national anthem, and the Internationale (the Soviet Unions national anthem) as a tribute to these countries. Why would the Dutch radio program do this? the three elements of nursing competency described in the quality and safety for nurses (qsen) initiative are knowledge, skill, and which other element? Why did the United States break diplomatic relations with Germany in 1917. A. Germany refused to accept President Wilsons Fourteen Points. B. Germany signed the Treaty of Brest-Litovsk with Russian Bolsheviks. C. Germany declared unrestricted submarine warfare against all ships. D. Germany sank the British liners Lusitania and Arabic in quick succession. E. Germany offered to help Mexico recover Texas, New Mexico, and Arizona. if a factory has 100,000 units of materials in the system and if the average flow rate of the system is 5,000 units per day, then according to little's law, the average throughput time is chavez corporation reported the following data for the month of july: inventories: beginningending raw materials$45,000$39,000 work in process$25,000$35,000 finished goods$41,000$56,000 additional information: raw materials purchases$75,000 direct labor cost$100,000 manufacturing overhead cost incurred$68,000 indirect materials included in manufacturing overhead cost incurred$11,600 manufacturing overhead cost applied to work in process$67,000 any underapplied or overapplied manufacturing overhead is closed out to cost of goods sold. the direct materials cost for july is: What are queries usually used for? Help! I have tried several times to figure out this question on coordinates and turning counter clockwise from the x axis. My professors notes indicate Im way off! (1/8) raised to -x ppwer= 64 raised to x powerI'll upload a picture The Creation of Adam by Michelangelo is a testament to his skillful depiction of intense _______ and advanced understanding of human _______.PLEASE HELP ME PLEASE What is -4/7 divided by 5? What is an equation of the line that passes through the points (-5,7) and (5,5)? Periodical appointments, however regulated, or by whomsoever made, would, in some way or other, be fatal to their necessary independence. "alexander hamilton, federalist no. 78 why does hamilton think judges should be appointed permanently rather than on a periodic basis? permanent appointments allow for greater regulation but less independence. periodic appointments promote a fatal independence. periodic appointments are hard to regulate. periodic appointments would destroy a judges independence. SUPER URGENT WILL GIVE BRANLIEST AND ALL THE POINTS I HAVE line a is parallel to line b. if the measure of7 is 144 what is the measure of4 For what value of x is sin ( x ) = cos 62, where 0 < x < 90? Choose all the sets containing the number pienatural numberswhole numbersintegersrational numbersirrational numbersreal numbers Kelly used a calculator to multiply large numbers. How can she write the number on her calculator screen in standard form? 3.15 E15 Which camera settings will cause the amount of light entering the lens to change? Hi I need help ASAP please and thank you