3.23 P03-02: Student Trend NOTE: There are two due dates for the assignment to a
ID: 3746938 • Letter: 3
Question
3.23 P03-02: Student Trend NOTE: There are two due dates for the assignment to allow for late submissions. The earliest due date on all Projects in these Zybooks is the actual due date (see syllabus if you ever have any doubts). The later due date on all Projects is for accepting late submissions (submissions submitted less than or equal to 24 hours after the actual due date) Write a complete C++ program to input 3 integer exam scores and then output the following three values (each on a line by itself): 1. exam average as a real number 2. whether the student is passing or failing, assuming an average of 70.0 or better is considered passing, and 3. how the student is "trending', where output"+*if the subsequent score is higher,"* if the subsequent score is identical, and if a subsequent score is lower Assume the inputs are valid exam scores in the range 0-100, inclusive. Here are some examples. Suppose the input is 80 81 84 The output would be the following: Average: 81.6667 Status: passing Trend: ++ The "trend is++ because the first two scores are 80 and 81, yielding+,and then the 2nd and 3rd scores are 81 and 84, yielding +again. However, suppose the inputs are 80 80 32Explanation / Answer
#include using namespace std; char trend(int n1, int n2) { if(n1 == n2) { return '='; } else if(n1 > n2) { return '-'; } else { return '+'; } } int main() { int n1, n2, n3; cin >> n1 >> n2 >> n3; double avg = (n1+n2+n3) / 3.0; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.