summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-05-16 17:23:23 -0700
committerFuwn <[email protected]>2024-05-16 17:23:23 -0700
commitb44710c5370129d59a2d2e12c70bac9269f7ecd5 (patch)
treed2907b6f529598e7a0f468b8f93e0d7267e34c44
downloadcst_136_assignment_07-b44710c5370129d59a2d2e12c70bac9269f7ecd5.tar.xz
cst_136_assignment_07-b44710c5370129d59a2d2e12c70bac9269f7ecd5.zip
f
-rw-r--r--.tup/dbbin0 -> 86016 bytes
-rw-r--r--.tup/object0
-rw-r--r--.tup/shared0
-rw-r--r--.tup/tri0
-rw-r--r--.vscode/settings.json11
-rw-r--r--College.hh30
-rw-r--r--College_Impl.cpp29
-rw-r--r--High_School.hh24
-rw-r--r--High_School_Impl.cpp0
-rw-r--r--School_Driver.cpp9
-rw-r--r--Tupfile8
-rw-r--r--University.hh26
-rw-r--r--University_Impl.cpp11
-rw-r--r--build/College_Impl.obin0 -> 161648 bytes
-rw-r--r--build/High_School_Impl.obin0 -> 1008 bytes
-rw-r--r--build/School_Driver.obin0 -> 28360 bytes
-rw-r--r--build/University_Impl.obin0 -> 142952 bytes
-rwxr-xr-xbuild/cst_136_assignment_07bin0 -> 5422808 bytes
18 files changed, 148 insertions, 0 deletions
diff --git a/.tup/db b/.tup/db
new file mode 100644
index 0000000..f326a8e
--- /dev/null
+++ b/.tup/db
Binary files differ
diff --git a/.tup/object b/.tup/object
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.tup/object
diff --git a/.tup/shared b/.tup/shared
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.tup/shared
diff --git a/.tup/tri b/.tup/tri
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.tup/tri
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..fc334da
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,11 @@
+{
+ "files.exclude": {
+ "**/.git": true,
+ "**/.svn": true,
+ "**/.hg": true,
+ "**/CVS": true,
+ "**/.DS_Store": true,
+ "**/Thumbs.db": true
+ },
+ "hide-files.files": []
+}
diff --git a/College.hh b/College.hh
new file mode 100644
index 0000000..5d75e42
--- /dev/null
+++ b/College.hh
@@ -0,0 +1,30 @@
+#pragma once
+
+#include "University.hh"
+
+class College {
+private:
+ std::string college_name;
+ std::string college_location;
+ int college_rank;
+ double reqd_gpa_for_admit;
+ University university_pin;
+
+public:
+ College() {}
+ College(std::string name, int rank, double gpa)
+ : college_name(name), college_rank(rank), reqd_gpa_for_admit(gpa) {}
+ College(std::string name, std::string location, int rank, double gpa,
+ University pin)
+ : college_name(name), college_location(location), college_rank(rank),
+ reqd_gpa_for_admit(gpa), university_pin(pin) {}
+
+ void set_college_name(std::string);
+ std::string get_college_name();
+ void set_college_location(std::string);
+ std::string get_college_location();
+
+ //......other setters and getters
+ // void operator==(const University&);
+ void print_pin(const University &);
+};
diff --git a/College_Impl.cpp b/College_Impl.cpp
new file mode 100644
index 0000000..6f9c66c
--- /dev/null
+++ b/College_Impl.cpp
@@ -0,0 +1,29 @@
+#include <iostream>
+#include <string>
+#include <utility>
+
+#include "College.hh"
+#include "University.hh"
+
+auto College::set_college_name(std::string name) -> void {
+ this->college_name = std::move(name);
+}
+
+auto College::get_college_name() -> std::string { return this->college_name; }
+
+auto College::set_college_location(std::string location) -> void {
+ this->college_location = std::move(location);
+}
+
+auto College::get_college_location() -> std::string {
+ return this->college_location;
+}
+
+// auto College::operator==(University) -> void {
+// // compare all fields of college and university
+// }
+
+auto College::print_pin(const University &) -> void {
+ std::cout << "University pin: " << this->university_pin.get_univ_pin()
+ << '\n';
+}
diff --git a/High_School.hh b/High_School.hh
new file mode 100644
index 0000000..8501456
--- /dev/null
+++ b/High_School.hh
@@ -0,0 +1,24 @@
+#pragma once
+
+#include "University.hh"
+
+class high_school {
+private:
+ std::string high_school_name;
+ std::string high_school_location;
+ int high_school_rank;
+ double reqd_gpa_for_admit;
+ University university_pin;
+
+public:
+ high_school() {}
+ high_school(std::string, int, double);
+ high_school(std::string, std::string, int, double, University);
+ void set_high_school_name(std::string);
+ std::string get_high_school_name();
+ void set_high_school_location(std::string);
+ std::string get_high_school_location();
+ //......other setters and getters
+ void operator==(University);
+ void print_pin(University);
+};
diff --git a/High_School_Impl.cpp b/High_School_Impl.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/High_School_Impl.cpp
diff --git a/School_Driver.cpp b/School_Driver.cpp
new file mode 100644
index 0000000..93532ca
--- /dev/null
+++ b/School_Driver.cpp
@@ -0,0 +1,9 @@
+#include "College.hh"
+#include "High_School.hh"
+#include "University.hh"
+
+auto main() -> int {
+ //
+
+ return 0;
+}
diff --git a/Tupfile b/Tupfile
new file mode 100644
index 0000000..70b4a96
--- /dev/null
+++ b/Tupfile
@@ -0,0 +1,8 @@
+BUILD_DIRECTORY=build
+CLANG_TIDY_CHECKS='-*,bugprone-*,clang-analyzer-*,concurrency-*,cppcoreguildelines-*,llvm-*,misc-*,modernize-*,performance-*,portability-*,readability-*'
+CC_FLAGS=-std=c++23 -I include -Weverything -Wno-padded -Wno-c++98-compat
+CC=zig c++
+
+: foreach *.cpp |> clang-tidy -checks=$(CLANG_TIDY_CHECKS) %f -- $(CC_FLAGS) |>
+: foreach *.cpp |> ^j^ $(CC) $(CC_FLAGS) -c %f -o %o |> $(BUILD_DIRECTORY)/%B.o
+: $(BUILD_DIRECTORY)/*.o |> $(CC) %f -o %o |> $(BUILD_DIRECTORY)/cst_136_assignment_07
diff --git a/University.hh b/University.hh
new file mode 100644
index 0000000..16f86be
--- /dev/null
+++ b/University.hh
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <string>
+
+class University {
+ // declare friend classes college and high_school here
+private:
+ std::string university_name;
+ int university_pin;
+ static int pin;
+
+public:
+ University() = default;
+ University(const University &);
+
+ virtual ~University() = default;
+
+ void set_univ_pin(int upin);
+ int get_univ_pin();
+ static void incrementPin() { pin += 1; }
+
+ // == typical returns a boolean, and since this is under the getters section,
+ // I'll take it that this was meant to be for assignment.
+ University &operator=(const University &) = default;
+ virtual void print_univ_pin();
+};
diff --git a/University_Impl.cpp b/University_Impl.cpp
new file mode 100644
index 0000000..c36d709
--- /dev/null
+++ b/University_Impl.cpp
@@ -0,0 +1,11 @@
+#include <iostream>
+
+#include "University.hh"
+
+auto University::set_univ_pin(int upin) -> void { this->university_pin = upin; }
+
+auto University::get_univ_pin() -> int { return this->university_pin; }
+
+auto University::print_univ_pin() -> void {
+ std::cout << "University pin: " << this->university_pin << '\n';
+}
diff --git a/build/College_Impl.o b/build/College_Impl.o
new file mode 100644
index 0000000..a1afef7
--- /dev/null
+++ b/build/College_Impl.o
Binary files differ
diff --git a/build/High_School_Impl.o b/build/High_School_Impl.o
new file mode 100644
index 0000000..27fadb0
--- /dev/null
+++ b/build/High_School_Impl.o
Binary files differ
diff --git a/build/School_Driver.o b/build/School_Driver.o
new file mode 100644
index 0000000..c9789e5
--- /dev/null
+++ b/build/School_Driver.o
Binary files differ
diff --git a/build/University_Impl.o b/build/University_Impl.o
new file mode 100644
index 0000000..f968af4
--- /dev/null
+++ b/build/University_Impl.o
Binary files differ
diff --git a/build/cst_136_assignment_07 b/build/cst_136_assignment_07
new file mode 100755
index 0000000..9c3d455
--- /dev/null
+++ b/build/cst_136_assignment_07
Binary files differ