This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<cmath> | |
| #define PI 3.14159265 | |
| using namespace std; | |
| int main() | |
| { | |
| //g stands for the acceleration due to gravity near the surface of the earth | |
| //eg:roughly 9.81m/s^2 | |
| double g = 9.81; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <cmath> // Note: Needed for math functions in part (3) | |
| using namespace std; | |
| int main() { | |
| double wallHeight; | |
| double wallWidth; | |
| double wallArea; | |
| cout << "Enter wall height (feet):" << endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //It doesn't get simpler than this | |
| //This is just some code I wrote to learn how to use arrays in c++ | |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| string command = "print"; | |
| int test [5] = {1,2,3,4,5}; | |
| while(command!="end"){ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| //back in the saddle again | |
| int main() { | |
| string loop = "y"; | |
| int woo; | |
| while(loop=="y"){ | |
| cout << "input number to count!!! "; | |
| cin >> woo; | |
| cout << "Great!!!" <<endl; |