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

Help with this C++, Im using microsoft studio 2013 1.Write a C++ program that ca

ID: 3816929 • Letter: H

Question

Help with this C++, Im using microsoft studio 2013

1.Write a C++ program that calculates average grade earned by a student in a Computer Science course which consists of two parts: lecture sessions and lab sessions.   The program should also determine the letter grade earned by the student. The average grade earned by a student is determined by adding the student’s total points earned in both parts of the course and dividing this value by the total points that were possible for the course. The letter grade is based on the standard 10-point value scale. (A = 90 – 100, B = 80 – 89, C = 70 – 79, etc.) Also determine the highest and lowest average recorded for the course.

a.Specify a structure named StudentRecord to store the following data for each student:

1.Student Name.

2.Total Points Earned by the student in the Lecture Sessions.

3.Total Points Earned by the student in the Lab Sessions.

4.Overall Total Points Earned by the student in the course.

5.Average Grade for the student.

6.Letter Grade Earned by the student.

b.Specify an array of records (structures) named student to store the data for each student in the course. Set the maximum number of students to 50, but let the user specify how many students are in the course.

c.Use main( ) as the driver function. You do not have to make the program repeatable.

d.Write appropriate functions that main( ) calls to accomplish the following tasks:

1.Read from the user the number of students taking the course and the total points that were possible for the course.

2.Read the following data for each student and store the data in each StudentRecord structure in the array: the student name, the total points earned in the lecture sessions, total points earned in the lab sessions.

3.Calculate the total points earned by each student, the average grade for each student, and determine the earned letter grade based on the calculated average. Store the total points earned, the average grade, and the earned letter grade in the appropriate member of the StudentRecord structure.

4.Determine the highest and lowest average recorded for the course.

5.Display the data for each student in a table format. Display all numeric values to a tenth of a decimal.

            Sample Input:

Enter the number of students enrolled in the course: ? 3

             Enter the total points that are possible for the course: 1200

            Enter the information for Student 1:

            Name: ? Mary Hill

                        Lecture Points Earned: 750

                           Lab Points Earned: 350

Enter the information for Student 2:

            Name: ? Mike Smith

                        Lecture Points Earned: 600

                           Lab Points Earned: 200

Enter the information for Student 3:

            Name: ? Lisa Dobbs

                        Lecture Points Earned: 725

                           Lab Points Earned: 275

Sample Output:


Student Name   Lecture Pts    Lab Pts    Total Pts   Average   Letter Grade
Mary Hill       750.0         350.0      1100.0      91.7         A

Mike Smith       600.0         200.0       800.0      66.7         D

Lisa Dobbs       725.0         275.0      1000.0      83.3         B

Highest Average: 91.7

Lowest Average: 66.7

Explanation / Answer

#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iomanip>
using namespace std;

struct student
{
int i,n,tot_pts,enroll,lect_pts,lab_pts;
char name[20];
float avg,tot;
char grade[5];
  
};
int main()
{
student s;
int n,tot_pts,a;
cout<<" Enter the number of students enrolled in the course:?"<<endl;
cin>>n;
cout<<" Enter the total points that are possible for the course:"<<endl;
cin>>tot_pts;
for(int i=0; i<n; ++i)
{
cout<<" Enter the information of student: "<<endl;
cin>>s.enroll;
cout<<" Name:"<<endl;
cin>> s.name;
cout<<" Lectuer Points Earned: "<<endl;
cin>>s.lect_pts;
cout<<" Lab Points Earned:"<<endl;
cin>>s.lab_pts;
cout << endl;
}
for(int i=0;i<n;++i)
{
s.tot = s.lect_pts + s.lab_pts;
s.avg = (s.tot/tot_pts)*100;
if(s.avg >= 90)
{
strcpy(s.grade,"A");
}
else if(s.avg>=80 && s.avg<=89)
{
strcpy(s.grade,"B");
}
else
{
strcpy(s.grade,"C");
}
}
for(int j=0;j<n;++j)
{
cout<<" Student Name Lecture Points Lab Points Total Points Average Letter Grade"<<endl;
cout<<fixed<<setprecision(1)<<" "<<s.enroll<<" "<<s.name<<" "<<s.lect_pts<<" "<<s.lab_pts<<" "<<tot_pts<<" "<<s.avg<<" "<<s.grade<<endl;
}
int max = 0,m;
for (int k=0; k<n; k++)
{
if (max < s.avg)
{
max = s.avg;
m = s.avg;
}
}
int min = 0,c;
for (int k = 0; k<n; k++)
{
if (min > s.avg)
{
min = s.avg;
c = s.avg;
}
}
cout<<fixed<<setprecision(2);
cout<<"Highest Average:"<<m<<endl;
cout<<"Lowest Average:"<<c;
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