Question: Lab Arrays & Vectors Activity Provide your C++ source code and screenshots of your program outputs. 1. The Fibonacci numbers are defined by the following

 Lab Arrays & Vectors Activity Provide your C++ source code andscreenshots of your program outputs. 1. The Fibonacci numbers are defined by

Lab Arrays & Vectors Activity Provide your C++ source code and screenshots of your program outputs. 1. The Fibonacci numbers are defined by the following sequence: fi = 1 f2 = 1 fn = fn-1 + fn-2 Write a program that computes the first 100 Fibonacci numbers and stores them in an array. The program then allows the user to enter an integer n (which is a strictly positive number, i.e. greater than 0) and displays the nth Fibonacci number, fn, that is stored in the array. 2. The following program maintains a list of country names, and another list indicating average minutes of TV watched per day in each corresponding country. #include #include #include using namespace std; int main() { // Source: www.statista.com, 2010 const int NUM_CTRY = 5; // Num countries supported vector ctryNames (NUM_CTRY); // Country names vector int> ctryMins (NUM_CTRY); // Mins TV watched daily string userCountry: // User defined country bool foundCountry = false; // Match to country supported int i = 0; // Loop index // Define vector contents ctryNames.at (0) = "China"; ctryMins.at (0) = 158; ctryNames.at (1) = "India"; ctryMins.at (1) = 119; ctryName3.at (2) = "Russia"; ctryMins.at (2) = 226; ctryNames at (3) = "UK"; ctryMins.at (3) = 242; ctryName3.at (4) = "USA"; ctryMins.at (4) = 283; // Prompt user for country name cout > userCountry: Page 1 of 2 // Find country's index and avgerage TV time foundCountry = false; for (i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!