diff options
| author | BensProgramma <[email protected]> | 2021-10-25 20:19:26 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-25 20:19:26 -0700 |
| commit | ffb16c8396088470d9ad3e87b72590bbbce27dc5 (patch) | |
| tree | 74ff7c9ca9fd487a2fe68150a46e180b20df4bba /CST116F2021-Lab4/CST116F2021-Lab4.cpp | |
| parent | Update CST116F2021-Lab4.cpp (diff) | |
| download | cst116-lab4-bensprogramma-ffb16c8396088470d9ad3e87b72590bbbce27dc5.tar.xz cst116-lab4-bensprogramma-ffb16c8396088470d9ad3e87b72590bbbce27dc5.zip | |
Update CST116F2021-Lab4.cpp
Diffstat (limited to 'CST116F2021-Lab4/CST116F2021-Lab4.cpp')
| -rw-r--r-- | CST116F2021-Lab4/CST116F2021-Lab4.cpp | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/CST116F2021-Lab4/CST116F2021-Lab4.cpp b/CST116F2021-Lab4/CST116F2021-Lab4.cpp index 5405309..d034256 100644 --- a/CST116F2021-Lab4/CST116F2021-Lab4.cpp +++ b/CST116F2021-Lab4/CST116F2021-Lab4.cpp @@ -5,47 +5,41 @@ -#include <iostream> ////Some of the functions used in this lab are here at the top -using namespace std; +#include <iostream> +using namespace std; -float average(float, float, float); +float average(float, float, float); ////Some of the functions used in this lab are here at the top -void GetInput(float&, int&); +void GetInput(float&, int&); ///Some of the other functions are initialized near the program they are a part of( below ) void CalcRaise(float&, int); int CalcBonus(int); //Pass by value void PrintCalculations(int, float, int); void mouse(char); void elephant(double& ); - - - - -// p207 -// -//int main() -// -//{ - +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///*7a //6.8 Exercises //pp 132-133 //5 pts #1-9 //Submit: value of “a” after the expression is executed -// 1) a = 3.0 -// 2) -nan(ind) -// 3) 32 -// 4) 25 -// 5) 6 -// 6) 6 -// 7) 5 -// 8) 5 -// 9) 4 -// + +// 1) a= sqrt(9.0); ... a = 3.0 +// 2) a= sqrt(-9.0); ... -nan(ind) +// 3) a = pow(2.0,5); ... a= 32 +// 4) a = pow(2.0,-2); ... a= .25 +// 5) a = ceil(5.1); ... a= 6 +// 6) a = ceil(5.9); ... a =6 +// 7) a = floor(5.1); ... a = 5 +// 8) a = floor(5.9); ... a = 5 +// 9) a = sqrt(pow(abs(-2),4)); a=4 // +//int main() +//{ // float a = 0; // a = sqrt(pow(abs(-2),4)); // cout << a; +//} //*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///* @@ -139,7 +133,7 @@ void elephant(double& ); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //// IN CLASS EXAMPLE of passing by reference and passing by value //////////////////////////////////////////////////////////////// //// -//// char c = 'A'; +//// char c = 'A'; //This program is just an extra exercise //// double d = 3.5; //// mouse(c); //// elephant(d); @@ -161,14 +155,11 @@ void elephant(double& ); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // 7c -//9.5 Learn by Doing Exercises -//p 216 -//10 pts #2 // 9.5_1 Learn by Doing Exercises p 216 // 1 Write a program to display times in different formats /* -# include<iomanip> -void getTime(int& hour, int& min, int& sec); +# include<iomanip> // included for formatting the spacing and such +void getTime(int& hour, int& min, int& sec); // 2 Functions initialized for this program(9.5_2 void displayTime(int,int,int,int F=3); int main() @@ -299,3 +290,4 @@ void displayTime(int hour,int min,int sec,int F) //Function to display the + |