#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;
int main() {
int test_scores;
int count1 = 0, count2 = 0, count3 = 0, count4 = 0;
int count5 = 0, count6 = 0, count7 = 0, count8 = 0;
int total_students = 0;
cout << "Enter student test scores (0-200). Enter -1 to finish: " << endl;
while (true) {
cout << "Enter score: ";
cin >> test_scores;
if (test_scores == -1) {
break;
}
if (test_scores >= 0 && test_scores <= 200) {
total_students++;
if (test_scores >= 0 && test_scores <= 24) {
count1 += 1;
cout << "The number of students in range 0-24 is " << count1 << endl;
}
else if (test_scores >= 25 && test_scores <= 49) {
count2 += 1;
cout << "The number of students in range 25-49 is " << count2 << endl;
}
else if (test_scores >= 50 && test_scores <= 74) {
count3 += 1;
cout << "The number of students in range 50-74 is " << count3 << endl;
}
else if (test_scores >= 75 && test_scores <= 99) {
count4 += 1;
cout << "The number of students in range 75-99 is " << count4 << endl;
}
else if (test_scores >= 100 && test_scores <= 124) {
count5 += 1;
cout << "The number of students in range 100-124 is " << count5 << endl;
}
else if (test_scores >= 125 && test_scores <= 149) {
count6 += 1;
cout << "The number of students in range 125-149 is " << count6 << endl;
}
else if (test_scores >= 150 && test_scores <= 174) {
count7 += 1;
cout << "The number of students in range 150-174 is " << count7 << endl;
}
else {
count8 += 1;
cout << "The number of students in range 175-200 is " << count8 << endl;
}
}
else {
cout << "Out of range" << endl;
}
}
if (total_students > 0) {
double midpoints[8] = {12.0, 37.0, 62.0, 87.0, 112.0, 137.0, 162.0, 187.5};
int frequencies[8] = {count1, count2, count3, count4, count5, count6, count7, count8};
string groupscore[8] = {"0-24", "25-49", "50-74", "75-99", "100-124", "125-149", "150-174", "175-200"};
To embed this project on your website, copy the following code and paste it into your website's HTML: