Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication1.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- #include <cmath>
- #include <string>
- using namespace std;
- int main()
- {
- double start = 0.01, sum = 0.0;
- for (int i = 1; i <= 30; i++)
- {
- start = start * 2;
- sum = sum + start;
- }
- cout << " The total for the penny compounded daily is " << sum << endl;
- cout << " This is end of dailies 5." << endl;
- system("pause");
- double number1 = 0;
- double number2 = 1;
- double number3;
- double times = 0;
- cout << " Enter number of fibonacci numbers to generate." << endl;
- cin >> times;
- cout << number1 << ", ";
- cout << number2 << ", ";
- for (int i = 1; i <= times; i++)
- {
- number3 = number1 + number2;
- cout << number3 << ",";
- number1 = number2;
- number2 = number3;
- }
- cout << "This is the end of dailies 6." << "/n";
- cout << " Ask a question." << endl;
- char question;
- cin >> question;
- string response;
- srand(time(NULL));
- int randomnumber = rand() % 5 + 1;
- switch (randomnumber)
- {
- case 1:
- response = "yes"; break;
- case 2:
- response = "No"; break;
- case 3:
- response = "Maybe"; break;
- case 4:
- response = "You may find out later."; break;
- case 5:
- response = "This shit ain't random."; break;
- }
- cout << response << endl;
- cout << "This is the end of dailies 7." << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment