Untitled

 avatar
unknown
plain_text
2 years ago
1.1 kB
9
Indexable
#include <iostream>
#include <iomanip>
using namespace std;

float mark, biggest, smallest, b_mark, s_mark, total;
int judges, counter;
int main ()
{
    cout << "Enter the number of judges: ";
    cin >> judges;
    while (judges < 4 || judges > 8){
        cout << "Invalid. Please enter a number between 4 to 8\n";
        cin >> judges;
    }

/* Mark for the judges */

    if (judges == 4){
        for (counter = 0; counter < 4; counter++){
            cout << "Enter mark between 0.0 to 10.0: ";
            cin >> mark;
            biggest = mark;
            if (biggest < mark){
                biggest = mark;
                biggest = b_mark;;
                smallest = mark;
                if (smallest > mark){
                    smallest = mark;
                    smallest = s_mark;
                }
            }
            total = total + mark;
        }
        cout << "The biggest mark is " << b_mark << endl;
        cout << "The smallest mark is " << s_mark << endl;
        cout << total;
}
}
Editor is loading...