Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication3.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()
- {
- int width;
- int length;
- cout << "this program calculates area and perimeter, please enter in width" << endl;
- cin >> width;
- cout << "Now please enter in the length" << "\n";
- cin >> length;
- int area = width* length;
- int perimeter = length * 2 + width * 2;
- cout << "area is " << area << "and perimeter is " << perimeter << "\n";
- cout << " this concludes Dailies 2 #1." << endl;
- double weight;
- double height;
- cout << "enter in weight" << endl;
- cin >> weight;
- cout << "enter in height" << "\n";
- cin >> height;
- double bmi = ((weight*.45) / (pow((height*.025), 2)));
- cout << "your bmi is " << bmi << "." << endl;
- cout << " This concludes Dailies 2 and 3" << "\n";
- double loanamount;
- double loanterminmonths;
- double monthlyinterestrate = (0.05 / 12);
- cout << "Enter loan amount. " << endl;
- cin >> loanamount;
- cout << "Enter total number of monthly payments." << "\n";
- cin >> loanterminmonths;
- double monthlypaymentamount = ((monthlyinterestrate*loanamount)*((pow((1 + monthlyinterestrate), loanterminmonths)) / ((pow((1 + monthlyinterestrate), loanterminmonths)) - 1)));
- cout << "This concludes #4 of Dailies 2." << "\n";
- 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