While the status is at C or L, I want the user to input the participation and print it to the screen. I can't get my online_adjustPa rticipation function to run either. Everytime I run it, it loops the same amount of times as the first loop.
Code:
#include <iostream> using namespace std; double examContrib(double exam, char status); double assignContrib(double assign, char status); double on_campus_examContrib(double exam); double online_examContrib(double exam); double on_campus_assignContrib(double assign); double online_assignContrib(double assign); double adjustParticip(double adjust, char status); double on_campus_adjustParticipation(double adjust); double online_adjustParticipation(double adjust); int main() { char status; double adjust, assign, exam, course_score = 0; cout << "Enter C for on-campus or L for online" << endl; cin >> status; while ( status != 'C'&& status != 'L'){ cout << "Enter again" << endl; cin >> status; } for (int i=0; i <4; i++){ cout << "Enter the exam score" <<endl; cin >> exam; course_score = course_score + examContrib(exam, status); cout << course_score << endl; } for (int b=0; b<5; b++){ cout << "Enter the assignment score" << endl; cin >> assign; course_score = course_score + assignContrib(assign, status); cout << course_score <<endl; } while(status == 'C'){ cout << "Enter the participation for on campus students" << endl; cin >> status; cout << on_campus_adjustParticipation(adjust)<< endl; } while(status == 'L'){ cout << "Enter the participation for online students" << endl; cin >> status; cout << online_adjustParticipation(adjust) << endl; } return 0; } double examContrib(double exam, char status){ double score; if (status == 'C'){ score = on_campus_examContrib(exam); } if (status == 'L'){ score = online_examContrib(exam); } return score; } double on_campus_examContrib(double exam){ double score; score = (exam *.10); return score; } double online_examContrib(double exam){ double score; score = (exam * .15); return score; } double assignContrib(double assign, char status){ double score; if (status == 'C'){ score = on_campus_assignContrib(assign); } if (status == 'L'){ score = online_assignContrib(assign); } return score; } double on_campus_assignContrib(double assign){ double score; score = (assign * .12); return score; } double online_assignContrib(double assign){ double score; score = (assign *.13); return score; } double adjustParticip(double adjust, char status){ double evaluation; if (status == 'C'){ evaluation = on_campus_adjustParticipation(adjust); } if (status == 'L'){ evaluation = online_adjustParticipation(adjust); } return evaluation; } double on_campus_adjustParticipation(double adjust){ if (adjust <= 4){ return 1; } if(adjust <= 7){ return 1.04; } if (adjust >= 8){ return 1.08; } } double online_adjustParticipation(double adjust){ if (adjust <= 3){ return 1; } if (adjust <= 6){ return 1.02; } if (adjust <= 9){ return 1.05; } if (adjust = 10){ return 1.08; } }
Comment