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 <fstream> | |
| #include <cmath> | |
| #include <cstdlib> | |
| using namespace std; | |
| //Function prototypes | |
| void getValidInput(double &, char); | |
| void readCoeffs(double [], int); |
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> | |
| struct equation_t | |
| { | |
| int coeffsCount = 3; | |
| double coeffs[coeffsCount] = {}; | |
| int rootsCount = 2; | |
| double roots[rootsCount] = {}; | |
| bool rootsExist = false; | |
| }; |
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; | |
| struct test_t { | |
| int arr_sz = 2; | |
| int* arr; | |
| int var = 7; | |
| }; |
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
| // from: http://www.cplusplus.com/forum/beginner/13044/#msg62827 | |
| #include <iostream> | |
| #include <sstream> | |
| #include <string> | |
| using namespace std; | |
| //---------------------------------------------------------------------------- | |
| template <typename T> | |
| struct input_t |
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
| def hotel_cost(nights): | |
| return 140 * nights | |
| def plane_ride_cost(city): | |
| costs = {"Charlotte": 183,"Tampa": 220, "Pittsburgh": 222, "Los Angeles": 475} | |
| return costs[city] | |
| def rental_car_cost(days): | |
| if days >= 7: | |
| return days * 40 - 50 |
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
| def hotel_cost(nights): | |
| return 140*nights | |
| def plane_ride_cost(city): | |
| if city == "Charlotte": | |
| return 183 | |
| elif city == "Tampa": | |
| return 220 | |
| elif city == "Pittsburgh": | |
| return 222 |
NewerOlder