Complete Programs only, Please run your program before submitting. Write a progr
ID: 3558520 • Letter: C
Question
Complete Programs only, Please run your program before submitting.
Write a program that prints all the scenarios where the GPA of a student is 3.0 or above. The student is taking three classes called 'EGN', 'EEL' and 'EEE'. Below are the possible grades and the corresponding grade-points. 4.0 3.0 2.0 0 The program should print all the cases where the student will get a GPA of 3.0 or above. Also, print the number of scenarios found (replace the question mark '?' in the output below with the actual value).Explanation / Answer
Program Code:
// GPAProg.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
int A=4,B=3,C=2,D=0;
int total=0;
int x,y,z;
int gpa=0;
cout<<"Scenarios where GPA >= 3.0 "<<endl;
if(x=A)
{
if(y=A)
{
z=A;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
z=B;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
z=C;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
z=D;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
y=B;
}
if(y=B)
{
z=A;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
z=B;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
z=C;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
z=D;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
y=C;
}
if(y=C)
{
z=A;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
z=B;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
z=C;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
z=D;
gpa=(x+y+z)/3;
if(gpa>=3)
cout<<gpa;
y=D;
}
system("pause");
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.