
Concept explainers
Please explain this code:
#include<iostream>
# define SIZE 30
using namespace std;
int main()
{
int stud_test[SIZE];
int index_stud;
int r1=0,r2=0,r3=0,r4=0,r5=0,r6=0,r7=0,r8=0;
cout<<"Please enter the number of students: ";
cin>>index_stud;
//input
for(int i=0;i<index_stud;i++)
{
cout<<"Enter the marks: ";
cin>>stud_test[i];
}
for(int i=0;i<index_stud;i++)
{
if((stud_test[i]>=0) && (stud_test[i]<=24) )
r1=r1+1;
else if((stud_test[i]>=25) && (stud_test[i]<=49))
r2=r2+1;
else if((stud_test[i]>=50) && (stud_test[i]<=74))
r3=r3+1;
else if((stud_test[i]>=75) && (stud_test[i]<=99))
r4=r4+1;
else if((stud_test[i]>=100) && (stud_test[i]<=124))
r5=r5+1;
else if((stud_test[i]>=125) && (stud_test[i]<=149))
r6=r6+1;
else if((stud_test[i]>=150) && (stud_test[i]<=174))
r7=r7+1;
else if ((stud_test[i]>=175) && (stud_test[i]<=200))
r8=r8+1;
}
cout<<"Number of students which lie in 00-24: "<<r1<<endl;
cout<<"Number of students which lie in 25-49: "<<r2<<endl;
cout<<"Number of students which lie in 50-74: "<<r3<<endl;
cout<<"Number of students which lie in 75-99: "<<r4<<endl;
cout<<"Number of students which lie in 100-124: "<<r5<<endl;
cout<<"Number of students which lie in 125-149: "<<r6<<endl;
cout<<"Number of students which lie in 150-174: "<<r7<<endl;
cout<<"Number of students which lie in 175-200: "<<r8<<endl;
}

Step by stepSolved in 2 steps

- debug the codearrow_forwardcout<<"Team name is is "< cout<<"The team got "<<no for (int i=0;i<no_of_medal cout<<medals[i]<< cout<<endl; Sport_team::~Sport_team() { delete []medals; cout<<"Memory free"<<endl } void f(Sport_team o) { cout<<"Team info print by o.print(); } void main() { Sport_team s; string n; int m; cout<<"Enter the sport's cin >>n ; cout<<"Enter number of me cin>>m; . set(n, m) ; s.print(); f(s) ; s.print();arrow_forward#include<iostream> #include <cmath> using namespace std; int main() { float sp_Radius, sp_sa, sp_Volume; cout << "\nPlease Enter the radius of a Sphere = "; cin >> sp_Radius; sp_sa = 4 * M_PI * sp_Radius * sp_Radius; sp_Volume = (4.0/3) * M_PI * sp_Radius * sp_Radius * sp_Radius; cout << "\nThe Surface Area of a Sphere = " << sp_sa; cout << "\nThe Volume of a Sphere = " << sp_Volume; return 0; } C++ use this code and separate the program into three files. The main program containing the main function should be named main.cpp. The function definition file containing a function for the volume calculation and a function for the surface area calculation should be named SphereCalc.cpp. The function declaration file containing function declarations for the functions should be named SphereCalc.h. Make sure you include a Header Guard. Read the Radius from the Keyboard. If a negative number is provided, set the calculated value to zero.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





