aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lawrance <[email protected]>2021-10-06 21:10:33 -0700
committerJames Lawrance <[email protected]>2021-10-06 21:10:33 -0700
commitae722b58628d00ecab06e87aba05c54bc1d96683 (patch)
treefbc20001102002fab52989100fa22d5415279375
parentTextbook pg. 72 section 4.3 #1 problem (diff)
downloadcst116-lab2-jemersonlawrance-ae722b58628d00ecab06e87aba05c54bc1d96683.tar.xz
cst116-lab2-jemersonlawrance-ae722b58628d00ecab06e87aba05c54bc1d96683.zip
Lab 2 work
-rw-r--r--CST116 Lab 2 Homework.txt40
-rw-r--r--CST116F2021-Lab2/CST116F2021-Lab2.cpp45
2 files changed, 76 insertions, 9 deletions
diff --git a/CST116 Lab 2 Homework.txt b/CST116 Lab 2 Homework.txt
index e69de29..99f2d98 100644
--- a/CST116 Lab 2 Homework.txt
+++ b/CST116 Lab 2 Homework.txt
@@ -0,0 +1,40 @@
+3a
+
+4.1 Exercises pg 63-64
+1. Numeric
+2. illegal
+3. String
+4. String
+5. Character
+6. Numeric
+7. illegal
+
+4.3 (coding problem, submitted on other file.)
+
+6.1 Exercises pg 122
+
+1. invalid, 5x should explicitly read 5*x
+2. invalid, 0 should be a variable
+3. valid
+4. invalid, 0 should be a variable
+
+3b
+
+4.12 Exercises pg 82-83
+1. problem: they are multiplying the old wage by .06, which would take .06%, not raise it by .06%.
+fix: (@line 3) New_wage = Old_wage * 1.06
+
+2. problems: First, the variable Assign_avg is used instead of the previously defined Assignment_avg/
+Second, don't multiply the individual test scores by .15.
+Third, Assign_avg (which should be Assignment_avg) should be multiplied by .30 instead of .20
+Lastly, Test_avg should be multiplied by .45, not .40
+
+fixes: Test_avg = (Test1 + Test2 + Test3)/3
+Class_score = assignment_avg *.30 + Test_avg * .45 + Final * .25
+
+3c
+
+4.13
+
+1. Variables needed: ProductionHours, PreProductionHours, ProducersHours, ProductionCost, PreProductionCost, ProducersCost, TotalCost
+2. (coding problem, submitted on other file.) \ No newline at end of file
diff --git a/CST116F2021-Lab2/CST116F2021-Lab2.cpp b/CST116F2021-Lab2/CST116F2021-Lab2.cpp
index 9292e27..93da427 100644
--- a/CST116F2021-Lab2/CST116F2021-Lab2.cpp
+++ b/CST116F2021-Lab2/CST116F2021-Lab2.cpp
@@ -4,12 +4,39 @@
#include <iostream>
using namespace std;
-int main()
-{
- int x;
- cin >> x;
- if (x == 5)
- {
- cout << x;
- }
-}
+// int main()
+// {
+ // int age = 19;
+ // float shoe_size = 8.5;
+ // int altitude = 0;
+ // char gender = 70;
+ // int weight = 175;
+ // return 0;
+// }
+
+//int main()
+//{
+ // char ascii = 67;
+
+ // cout << ascii << '\n';
+
+ // ascii = 43;
+ // cout << ascii << '\n';
+ // cout << ascii << '\n';
+
+ // return 0;
+//}
+ //
+
+//int main()
+//{
+ // int days_in_year = 365;
+ // int age = 18;
+ // int age_in_days = days_in_year * age;
+
+ // cout << "My age in days since my 18th birthday: "
+ // << age_in_days;
+
+ // return 0;
+
+ //}; \ No newline at end of file