Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that prints all the scenarios where the GPA of a student is 2.5

ID: 3911094 • Letter: W

Question

Write a program that prints all the scenarios where the GPA of a student is 2.5 or above. The student is taking three classes called ‘EGN’, ‘EEL’ and ‘EEE’. The classes have the same number of credits. Below are the possible grades and the corresponding grade-points.

Write a program that prints all the scenarios where the GPA of a student is 2.5 or above. The student is taking three classes called 'EGN', 'EEL' and 'EEE'. The classes have the same number of credits. Below the possible grades and the corresponding grade-points. The program should print all the cases where the student will get a GPA of 2.5 or above. Also, print the number of scenarios found (replace the question mark " in the output below with the actual value). In your program, write and use a function that converts a GP grade (4 to 0) to a letter grade (A to F) Scenarios where GPA 2.5 Number of scenarios: ? EGN EEL EEE GPA A A A4.0

Explanation / Answer

//program is written in c++ for given problem

#include<iostream>

#include<iomanip>

using namespace std;

int main(){

int count=0,i,j,k;

char grade;

float avg;

cout<<"EGN EEL EEE GPA GRADE ";

cout<<"-------------------------------------- ";

for(i=4;i>=0;i--){

for(j=4;j>=0;j--){

for(k=4;k>=0;k--){

avg=float(i+j+k)/3;

if(avg>=2.5){count++;

cout<<i<<" "<<j<<" "<<k<<" "<<fixed<<setprecision(2)<<avg<<" ";

if(avg==4.0)grade='A';

else if(avg<4.0&&avg>=3.0)grade='B';

else if(avg<3.0&&avg>=2.5)grade='C';

cout<<grade<<" ";

}

}

}

}

cout<<"Total no of senario: "<<count<<" ";

return 0;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote