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
Lady bird [3.3K]
3 years ago
12

5.9.5 Fibonacci Y’all I’m struggling here do any of you have the code?

Computers and Technology
1 answer:
Alenkinab [10]3 years ago
8 0

The Fibonacci program is an illustration of loops

<h3>What are loops?</h3>

Loops are program statements that are used to perform repetition

<h3>The main program</h3>

The program written in Python, where comments are used to explain each line is as follows:

#This gets the number of terms

nterms = int(input("Terms: "))

# This initializes the first two terms

n1, n2 = 0, 1

kount = 0

# This generates fibonacci sequence

while kount < nterms:

   print(n1)

   nth = n1 + n2

   # This update the values

   n1, n2 = n2, nth

   kount += 1

Read more about loops at:

brainly.com/question/14284157

You might be interested in
Write a recursive method that tests whether a string is a palindrome. It should return a boolean T or F depending on whether or
Sveta_85 [38]

Answer:

// program in java.

// library

import java.util.*;

// class definition

class Main

{

// recursive function to check palindrome

   public static boolean isPalin(String str){

// base case

     if(str.length() == 0 ||str.length()==1){

        return true;

     }

// if first character is equal to last

     if(str.charAt(0) == str.charAt(str.length()-1))

     {

     // recursive call

        return isPalin(str.substring(1, str.length()-1));

     }

     // return

     return false;

  }

  // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // object to read input

Scanner scr=new Scanner(System.in);

System.out.print("Enter a string:");

 // read string from user

String myString =scr.nextLine();

 // call function to check palindrome

     if (isPalin(myString)){

        System.out.println("Given String is a palindrome");

     }

// if string is not palindrome

     else{

        System.out.println("Given String is not a palindrome");

     }    

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read a string from user and assign it to variable "myString" with scanner object. Call the method isPalindrome() with string input parameter.In this method, if  length of string is 0 or 1 then it will return true(base case) otherwise it will call itself and compare first character with last character.If string is palindrome then function will return true else return false.

Output:

Enter a string:ababa                                                                                                      

Given String is a palindrome

8 0
4 years ago
Keyshia wants to add movement to her PowerPoint presentation. Which tab should she use to complete this task
jolli1 [7]

Answer: I belive transitions

Explanation:

6 0
3 years ago
Read 2 more answers
Explain the development, design and implementation aspects of algorithms in the development of software.
shtirl [24]

Explanation:

Phases of software development are ;

1. Requirements analysis

2.Domain analysis

3.Client-oriented design

4.Implementation-oriented design

5.Implementation

6.Integration

7.Packaging.

Ongoing Activities in Software Development

1. Risk analysis

2. Planning

3.Verification

4.Documentation

8 0
3 years ago
If You're is in credit card debt, why can't you just say your card was stolen so you can avoid the debt.
liubo4ka [24]
You can not claim this because most times credit card issuers will be able to match purchases and charges to your location, ex stores around you, online purchases sent to your location.
8 0
3 years ago
Read 2 more answers
Suppose you are asked to design a rotating disk where the number of bits per track is constant. You know that the number of bits
Olenka [21]

Answer:

suppose i was i would tell them i dont know and walk away

Explanation:

in thoery this is correct

you said suppose so i answerd

there is no use in reporting or getting this taken down

nether is it right

im not stealing points

Because in thoery its an answer

<em><u>THIS IS MY PROTEST</u></em>

6 0
3 years ago
Other questions:
  • What is the core of an operating system that manages memory and devices, maintains the computer’s clock, starts programs, and as
    7·1 answer
  • Write a program that a C++ program that can be used to determine grades at the end of the semester. For each student, who is ide
    12·2 answers
  • Which firewall monitors traffic from the DMZ to the LAN?
    11·1 answer
  • I'd: 9872093250, password: qqqqq, join the meeting​
    11·1 answer
  • Computer data that is suitable for text​
    5·1 answer
  • What is the widest area network?
    15·1 answer
  • 21. If you want to improve the performance of your PC, you need to upgrade the
    7·1 answer
  • after confirming the removal of a virus from a computer, how should the technician ensure and verify the full functionality of t
    7·1 answer
  • Designing a medium to large network requires a combination of technologies and there isn't one "right way." Think about the tech
    9·1 answer
  • compare the two methods of creating table in ms access ( Datasheet view and Design view) which one wouldyou prefer to use to rec
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!