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

Can anyone solve this for me using C++ programming? Please use switches for the

ID: 3594358 • Letter: C

Question

Can anyone solve this for me using C++ programming?

Please use switches for the letter grades

Here is an output example:

In case, you want to know how to calculate the GPA:

Problem Professor Raphael at Dexter Institute of Technology (DIT) would like to have a program to calculate the students' cumulative GPA (CGPA). DIT has the following GPA rules where it has the following GPA points conversion: A: 4.0 B: 3.5 C: 3.0 D: 2.0 F: 0 Your task is to create the cumulative GPA for each student based on the professor's input. The input/output of the program should be as follows: .The user will enter the number of students that he/she want to calculate the CGPA The program will prompt the user to enter the first name and last name of the student The program will prompt the user to enter the number of courses For each course, the program will prompt the user to enter the letter grade received in the course, and the number of credit hours of the course. . After capturing the course letter grade, and the credit hours for each course, the program should calculate the cumulative GPA and display it to the user The process wlre for atudent based on the number oftuententeredbthe use

Explanation / Answer

#include<iostream>
#include<string>
using namespace std;
int main()
{
   int number,courses,hours;
   char grade;
   string fname,lname;
   cout<<"Enter number of students: ";
   cin>>number;
   while(number--)
   {
       cout<<"Enter student First name: ";
       cin>>fname;
       cout<<"Enter student Last name: ";
       cin>>lname;
       cout<<"How many courses do you have: ";
       cin>>courses;
       float Total_GPA=0.0,total=0.0;
       int credit=0,k;
       for(int i=1;i<=courses;i++)
       {
           k=1;
           cout<<"Enter course letter grade for course "<<i<<":";
           cin>>grade;
           switch(grade)           //using switch here
           {
               case 'A':
               cout<<"Enter credit hours for course "<<i<<":";
               cin>>hours;
               credit=credit+hours;
               Total_GPA=Total_GPA+4.0*hours;
               break;
               case 'B':
               cout<<"Enter credit hours for course "<<i<<":";
               cin>>hours;
               credit=credit+hours;
               Total_GPA=Total_GPA+3.5*hours;
               break;
               case 'C':
               cout<<"Enter credit hours for course "<<i<<":";
               cin>>hours;
               credit=credit+hours;
               Total_GPA=Total_GPA+3.0*hours;
               break;
               case 'D':
               cout<<"Enter credit hours for course "<<i<<":";
               cin>>hours;
               credit=credit+hours;
               Total_GPA=Total_GPA+2.0*hours;
               break;
               case 'F':
               cout<<"Enter credit hours for course "<<i<<":";
               cin>>hours;
               credit=credit+hours;
               Total_GPA=Total_GPA+0.0*hours;
               default:
               cout<<"Not valid grade ";
               i--;
           }
           k++;
       }
       total=Total_GPA/(float)credit;
       cout<<"Total GPA Grade for "<<fname<<" "<<lname<<" is: "<<total;
       cout<<endl;
   }  
}