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
Serga [27]
3 years ago
9

Write an application program in C++ to implement a class Fibonacci to print Fibonacci series upto N using member function series

() .
​

Computers and Technology
1 answer:
fiasKO [112]3 years ago
5 0

Answer:

Program approach:-

  • Using the header file.
  • Using the standard namespace I/O.
  • Define the main function.
  • Display the number of terms.
  • Display the Fibonacci series.
  • Print the first two numbers.

Explanation:

Program:-

//header file

#include <iostream>

//using namespace

using namespace std;

//main function

int main() {

   int n, s1 = 0, s2 = 1, nextTerm = 0;

//display the number of terms

   cout << "Enter the number of terms: ";

   cin >> n;

//display the Fibonacci series

   cout << "Fibonacci Series: ";

   for (int j = 1; j <= n; ++j) {

       // Prints the first two terms.

       if(j == 1) {

           cout << s1 << ", ";

           continue;

       }

       if(j == 2) {

           cout << s2 << ", ";

           continue;

       }

       nextTerm = s1 + s2;

       s1 = s2;

       s2 = nextTerm;

       

       cout << nextTerm << ", ";

   }

You might be interested in
1. Grade data is:
horrorfan [7]

Answer:

1.)

import math

def min_max(lst):

   minimum = math.inf

   maximum = -math.inf

   for x in lst:

       if minimum > x:

           minimum = x

       elif maximum < x:

           maximum = x

   return minimum, maximum

2.)

def deltaGrade(lst):

   sm = 0  #sm is sum

   for x in lst:

       sm += x

   mean = sm/len(lst)

   deltaG = 75 - mean

   return deltaG

7 0
3 years ago
For this exercise, you are going to create a part of an Animal hierarchy. Unlike some of our examples and the previous exercises
kati45 [8]

Answer:

vehicle super class 9.1.4

Explanation:

So you need to create a super class containig all the animals use the class above for referance

5 0
3 years ago
Design and write a class that implements an ordered list type using a linked list, and a program that exercises and tests the cl
-Dominant- [34]

Answer:

A

Explanation:

7 0
3 years ago
What type of object can offer the most effective way to display data and calculations in a presentation?
poizon [28]

This is definitely an opinion, but an excel you can do A and D and just about the same as B also

<u>So i'd say C </u>

8 0
2 years ago
Cloud offers better protection compare to on premise?​
dangina [55]

Why is cloud better than on-premise? Dubbed better than on-premise due to its flexibility, reliability and security, cloud removes the hassle of maintaining and updating systems, allowing you to invest your time, money and resources into fulfilling your core business strategies.

The security of the cloud vs. on-premises is a key consideration in this debate. Cloud security controls have historically been considered less robust than onprem ones, but cloud computing is no longer a new technology. . A company running its own on-premises servers retains more complete control over security.

Believe it!!

Pls follow me.

6 0
3 years ago
Other questions:
  • Using the merge method of the Map interface, which statement correctly updates the salesTotalByDept map of type Map to update th
    7·1 answer
  • Jill needs to create a chart for technology club that shows what percentage of total students in the school play video games. Wh
    11·2 answers
  • With ____ editing, Word automatically displays a Paste Options button near the pasted or moved text.
    14·1 answer
  • FIND THE 6 ERRORS IN THIS RESUME 30 POINTS!!!!
    12·1 answer
  • What are the three fundamental principals of mnemonics??
    6·2 answers
  • What does a file association specify?
    10·2 answers
  • Anyone here play osu! ?
    11·2 answers
  • Which of the following is an operating system?<br> MacBook Air<br> Windows 10<br> Dell
    13·2 answers
  • 7.4 Lesson Practice (projectstem): what is output if the user is enters 2?​
    8·1 answer
  • I will give brainliest to the best answer. what is a good screen recorder
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!