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
What is the purpose of HTML?
Basile [38]
You can style and structure with it so it’s either one of those
3 0
3 years ago
ANSWER QUICKLY!!! <br><br> What is an advantage of digital portfolios?
algol13
Easy to carry or utilize
8 0
2 years ago
What is thisssssssss please answer
True [87]

Answer:

first of all, are you a snake? And also that is a spotlight.

Explanation:

3 0
3 years ago
The efficinecy for solving the towers of hanoi problem recursively
V125BC [204]

Answer:

B.O(2n)

Explanation:

The time complexity of solving towers of hanoi problem recursively is O(2n) because there are two recursion calls in the solution of tower of hanoi.First recursive call to move n-1 disks to from source to helper then the user moves nth disk from source to destination after that recursion moves n-1 disks from helper to destination using source as helper rod.So each recursive call make two more recursive call this makes the time complexity be O(2n).

8 0
4 years ago
Technology experts in the area of _____ specialize in technology for competitive advantage. a. process design b. hardware strate
Arte-miy333 [17]

Answer:

The correct answer to the following question will be Option B (Hardware strategy).

Explanation:

<u>Hardware strategy:</u>

It looks at existing infrastructure for software, hardware, and services and discusses the designs of physical databases.

Hardware Strategy should try and identify any technological threats or limitations surrounding the following:

  • Quality
  • Maintenance
  • Delivery
  • Scalability
  • Disaster recovery
  • Sizing

This approach also aims at maximizing the importance of existing technical resources. The team looks at the efficient use of software and their overall transition to company and technological environments.

Therefore, Option B is the right answer.

3 0
3 years ago
Other questions:
  • Consider the situation you addressed in the previous question. Create numeric cost estimates for each of the costs you listed. C
    10·1 answer
  • What is the definition of online communication
    15·1 answer
  • This IDS defeating techniques works by splitting a datagram or packet into multiple fragments and the IDS will not spot the true
    8·1 answer
  • Ingrid started speaking about her slide presentation. When she clicked to th
    11·2 answers
  • Software for pcs contains a ________ program that guides you through the installation process.​​
    7·2 answers
  • Apollo Couriers, a company providing international express mail services, has a proactive customer communications team. The prim
    8·1 answer
  • Which task is most suitable for creating an algorithm?
    15·2 answers
  • Gimme a Krabby Patty
    8·2 answers
  • IMPORTANT!!<br><br> How can you get real answer keys for edmentum (plato) courses as a student?
    11·1 answer
  • Charlie makes pizza at a restaurant. The customers always compliment how great the pizza tastes. But Charlie takes a long time t
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!