Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================
- // File Name : Courses.cpp
- // Author : You
- // Version : 1.0
- // Copyright : Your copyright notice (if applicable)
- // Description : C++ project 1 for CSCE 113
- //============================================================================
- // Your code starts here
- #include "Courses.h"
- #include <iostream>
- #include <vector>
- using namespace std;
- double Courses::get_final_score() const {return final_score;}
- void Courses::calc_final_score()
- {
- double quiz_average=90*0.05;
- double test_average=90*0.45;
- double homework_average=90*0.50;
- final_score= quiz_average + test_average + homework_average;
- };
- void Courses::calc_letter_grade()
- {
- if(final_score >= 90)
- {
- letter_grade = 'A';
- }
- if(80>= final_score <= 89)
- {
- letter_grade = 'B';
- }
- if(70>= final_score <= 79)
- {
- letter_grade = 'C';
- }
- if(final_score <= 69)
- {
- letter_grade = 'F';
- }
- };
- void Courses::display() const
- {
- Courses C;
- cout<< C.get_final_score() << endl;
- cout<< letter_grade << endl;
- };
- int main()
- {
- Courses C;
- C.display();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement