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

I need help. It\'s in C++. Your job is to create a program that takes, from keyb

ID: 3886984 • Letter: I

Question


I need help. It's in C++.

Your job is to create a program that takes, from keyboard input 1. The number of students in the class 2, number of points for an assignment 3. grades for the class You will average the grade and figure out how much of a curve should be applied for the average class score to be a 70%. A curve should never be negative. Therefore if the calculation of the curve IS negative, the curve will be 0. It need a for loop. and the curve for less than 70% is 5 points and more than 70% no curve with a if statement. I need help please

Explanation / Answer

#include<iostream>
using namespace std;
int main()
{
   int n;//variable to store number of students
   int p;//variable to store number of points for assignment
   int g[n];////variable to store grades..
  
   int sum=0,rsum=0;//for calculating sum
   //taking input..
   int i=0;
   cout<<"Enter number of students :";
   cin>>n;
  
   cout<<"Enter number of points for assignment :";
   cin>>p;
  
   cout<<"Enter "<<n<<" grades (0 to "<<p<<" ): "   ;
   while(i<n)
   {
       cin>>g[i];
       sum = sum+g[i];
       rsum =rsum+p;
   i++;  
   }
  
   float average =sum/n;//finding average///
   float curvevalue = 0.7*rsum;//curve at 70% to find curve

   //if condition.. to find curve value..
   if(average>=curvevalue)//means curve is zero..no curve..
   {
       cout<<"Curve is zero ";
   }
   else
   {
       cout<<"average shoulde be increased by "<<curvevalue-average<<" to reach 70% ";
   }
  
  
  
   return 0;
}

output:-

Enter number of students :6
Enter number of points for assignment :10
Enter 6 grades (0 to 10 ):
9
3
2
4
8
6
average shoulde be increased by 37 to reach 70%


Process exited normally.
Press any key to continue . . .