diff options
| author | Carlos Maiolino <[email protected]> | 2025-07-10 22:24:20 +0200 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2025-07-10 22:24:20 +0200 |
| commit | 869e68986aa8f69af6e7842260a68d1e5c6f796f (patch) | |
| tree | 63b6b5ffc3d19414233d4629a533c0d9bf3cbf72 /CPP/Basics/Ex2/CodeDemo.cpp | |
| parent | 20834dcc57537cd95260a4a22f5d91a027adfd35 (diff) | |
Add a bunch of code
Signed-off-by: Carlos Maiolino <[email protected]>
Diffstat (limited to 'CPP/Basics/Ex2/CodeDemo.cpp')
| -rw-r--r-- | CPP/Basics/Ex2/CodeDemo.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/CPP/Basics/Ex2/CodeDemo.cpp b/CPP/Basics/Ex2/CodeDemo.cpp new file mode 100644 index 0000000..0afcd7a --- /dev/null +++ b/CPP/Basics/Ex2/CodeDemo.cpp @@ -0,0 +1,43 @@ +// Learning C++
+// Challenge 04_05
+// Calculate a GPA, by Eduardo CorpeƱo
+
+#include <iostream>
+#include <vector>
+#include "records.h"
+
+using namespace std;
+
+void init_students();
+
+StudentRecords SR;
+int id;
+
+int main()
+{
+ init_students();
+
+ cout << "Enter a student ID: ";
+ cin >> id;
+
+ SR.report_card(id);
+ return 0;
+}
+
+void init_students()
+{
+ SR.add_student(1,"George P. Burdell");
+ SR.add_student(2,"Nancy Rhodes");
+
+ SR.add_course(1,"Algebra",5);
+ SR.add_course(2,"Physics",4);
+ SR.add_course(3,"English",3);
+ SR.add_course(4,"Economics",4);
+
+ SR.add_grade(1,1,'B');
+ SR.add_grade(1,2,'A');
+ SR.add_grade(1,3,'C');
+ SR.add_grade(2,1,'A');
+ SR.add_grade(2,2,'A');
+ SR.add_grade(2,4,'B');
+}
|
