aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBensProgramma <[email protected]>2021-10-25 11:43:30 -0700
committerGitHub <[email protected]>2021-10-25 11:43:30 -0700
commitb0ba3c7bd7418f70e4f18691286de87273af3696 (patch)
treebf30b4db596262f8b510d17e1eada2a54ba62b0f
parentUpdate CST116F2021-Lab4.cpp (diff)
downloadcst116-lab4-bensprogramma-b0ba3c7bd7418f70e4f18691286de87273af3696.tar.xz
cst116-lab4-bensprogramma-b0ba3c7bd7418f70e4f18691286de87273af3696.zip
Update CST116F2021-Lab4.cpp
-rw-r--r--CST116F2021-Lab4/CST116F2021-Lab4.cpp58
1 files changed, 26 insertions, 32 deletions
diff --git a/CST116F2021-Lab4/CST116F2021-Lab4.cpp b/CST116F2021-Lab4/CST116F2021-Lab4.cpp
index 11d8f75..1c8eae7 100644
--- a/CST116F2021-Lab4/CST116F2021-Lab4.cpp
+++ b/CST116F2021-Lab4/CST116F2021-Lab4.cpp
@@ -19,24 +19,25 @@ void elephant(double& );
// p207
-int main()
+//int main()
-{
+//{
- /*7a
+/*
+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
float a = 0;
@@ -50,11 +51,12 @@ p 207
10 pts #1
Submit: code & run
-//
+// int main()
+// {
//
// average(3.2, 6.0, 8.6);
// return 0;
-//}
+// }
//
// float average(float x, float y, float z)
// {
@@ -67,9 +69,10 @@ Submit: code & run
9.4 Learn by Doing Exercises
p 214
10 pts #1
-*/
-//
-//
+*/
+// //FUNCTIONS ARE INTIALIZED AT THE TOP AND DEFINED BELOW main()
+// int main()
+// {
// int years_service = 0;
// float salary = 0.0;
//
@@ -86,7 +89,7 @@ p 214
//
//
// return 0;
-//}
+// }
//
//
//void GetInput(float& sal, int& years_serv) // salary, and years_service have been passed by reference (Global Changes)
@@ -97,9 +100,7 @@ p 214
// {
// cout << "Enter the employee's years of service: ";
// cin >> years_serv;
-// }
-//
-//
+// }
//}
//
//void CalcRaise(float& salary, int years_service) //copy of years_service has been sent here
@@ -115,8 +116,7 @@ p 214
// else
// {
// salary = salary*1.02;
-// }
-//
+// }
//}
//
//
@@ -140,30 +140,24 @@ p 214
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// In class example of passing by reference and passing by value ////////////////////////////////////////////////////////////////
-//
+//int main()
+//{
// char c = 'A';
// double d = 3.5;
// mouse(c);
// elephant(d);
// cout << "The char VAlUE is: " << c << ".\n\n";
// cout << "The double VAlUE is: " << d << ".\n\n";
-//
//}
//void mouse(char littleChar)
//{
// cout << "The char Value passed was: " << littleChar << ".\n\n";
// littleChar = 'B';
-//
-//
-//
-//
//}
-//
//void elephant(double& bigNum)
//{
// cout << "The Reference VAlUE passed to: " << bigNum << ".\n\n";
-// bigNum = 153.15;
-//
+// bigNum = 153.15;
//}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////