Server IP : 172.16.15.8 / Your IP : 18.224.30.113 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/jwmccreary/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
// gradelnklistclient - client to test gradelnklist class // // Sepetember 2008 // CS 311 // Justin McCreary // Professor: Mrs. Ames // file name: gradelnklistclient.cpp // compile: g++ gradelnklistclient.cpp // run: ./a.out // Uses studgradelnklist.cpp #include <iostream> #include "gradelnklist.cpp" using namespace std; int main() { GradeList mygrades; //for list of grades float avg; // for average int occur; // for HowManyofGrade mygrades.Display(); mygrades.InsertGrade(100); mygrades.InsertGrade(70); mygrades.InsertGrade(75); mygrades.InsertGrade(92); mygrades.InsertGrade(75); mygrades.InsertGrade(70); mygrades.InsertGrade(75); mygrades.InsertGrade(88); mygrades.InsertGrade(99); mygrades.InsertGrade(99); mygrades.InsertGrade(68); mygrades.InsertGrade(68); mygrades.Display(); mygrades.DropLowestGrade(); mygrades.DeleteGrade(70); mygrades.Display(); mygrades.DropLowestGrade(); mygrades.DeleteGrade(100); mygrades.DeleteGrade(70); mygrades.DeleteGrade(75); mygrades.DeleteGrade(92); mygrades.DeleteGrade(75); mygrades.DeleteGrade(75); mygrades.DeleteGrade(55); //Nonexistent grade to ensure no errors if grade not found mygrades.Display(); avg = mygrades.CalculateAvg(); cout << "\nMy average is: " << avg << "\n"; occur = mygrades.HowManyofGrade(88); cout << "\nThe grade " << "88" << " occurs: " << occur << " time(s).\n"; occur = mygrades.HowManyofGrade(85); //Nonexistent grade to ensure no errors if grade not found cout << "\nThe grade " << "85" << " occurs: " << occur << " time(s).\n\n"; mygrades.DeleteGrade(88); mygrades.DeleteGrade(99); mygrades.DeleteGrade(99); mygrades.Display(); avg = mygrades.CalculateAvg(); cout << "\nMy average is: " << avg << "\n"; return 0; }