aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Hello World/Hello World/Program.cpp100
1 files changed, 89 insertions, 11 deletions
diff --git a/Hello World/Hello World/Program.cpp b/Hello World/Hello World/Program.cpp
index 499dfd4..46d0835 100644
--- a/Hello World/Hello World/Program.cpp
+++ b/Hello World/Hello World/Program.cpp
@@ -1,7 +1,7 @@
-// Name: Yana Blashchishina
-// Date: 1/9/24
-// Class: CST116
-// Assignment:
+// Name: Yana Blashchishina
+// Date: 11/15/24
+// Class: CST116
+// Assignment: Homework 1
#include <iostream>
@@ -10,19 +10,97 @@ using std::cin;
using std::endl;
+union MyUnion {
+ int number;
+ double cash;
+ bool amBroke;
+
+};
+
+enum Action {
+ DeleteFile,
+ MoveFile,
+ StartService
+};
+
+struct MyStruct {
+ Action dataType;
+ MyUnion data;
+
+};
+
+
int main()
+
{
+ MyStruct myData;
+ myData.dataType = DeleteFile;
+ myData.data.number = 86;
+
+
+ int o = 15;
+ int p = 10;
+ int y = 5;
+
+
+
+
+ const int a = 1024;
+ cout << "Constant Interger is: " << a << endl;
+
+
+
+ cout << "Enter first interger: ";
+ cin >> o;
+ cout << "Here is your interger: " << o << endl;
+
+ cout << "Enter second interger: ";
+ cin >> p;
+ cout << "Here is your interger: " << p << endl;
+
+ cout << "Enter third interger: ";
+ cin >> y;
+ cout << "Here is your interger: " << y << endl;
+
+
+ int sum = o + p + y;
+ cout << "Sum of the three intergers: " << sum << endl;
+
+ int product = o * p * y;
+ cout << "Mulitplied value of sum: " << product << endl;
+
+ int sum1 = o + p + y - a;
+ cout << " The difference between sum and const: " << sum1 << endl;
+
+ int sum2 = o * p * y - a;
+ cout << "Multiplied sum minus const: " << sum2 << endl;
+
+
+
+
+
+
+ MyUnion _union{
+ _union.number = 54
+
+
+ };
+
+ cout << _union.number << endl;
+
+ typedef MyStruct dataType;
+
- cout << "Hello World" << endl;
- int i;
+ enum Action {
+ DeleteFile = 86,
+ MoveFile = 6,
+ StartService
+ }actionRoles;
- cout << "Enter a whole number: ";
+ cout << DeleteFile << endl;
- cin >> i;
- cout << "Here's your number: " << i << endl;
+ return 0;
-
- return 0;
} \ No newline at end of file