c++ programmin problem please ! any one can show how this be?

A PROGRAM THAT READS IN THE EXAMINATION NUMBER OF CANDIDATES IN RANGE OF 0-32768 TOGETHER WITH THE PERCENTAGE MARKS ATTAINED IN A GIVEN EXAMINATION .THE MARKS SHOULD BE GRADED AS FOLLOWS ;

OVER 70%,A; 60-69%,B; 50-59%,C; 40-49%,D; BELOW 40%,F.

THE PROGRAM SHOULD PRINT UNDER SUITABLE HEADINGS ,CANDIDATES NUMBERS ,MARKS AND GRADE FOR EACH CANDIDATES .ARRANGE THE PROGRAM TO STOP WHEN INVALID CANDIDATE NUMBER IS ENTERED .

SOLUTION SHOULD EXERCISE PROPER USE OF FUNCTIONS TO MAKE CODE MODULAR.
I don't see how it can be either. What is this for, a school that makes the students feel good about themselves for failing everything? I mean really, 60 is a B?! That is INSANE.

90+ A 80+ B 70+C and then F ... that was what we had back when people had to try to succeed... grumble...

lol bruh have you ever had a Chemistry class? Everyone does poorly, but they curve it so a 60% being a B actually sounds kinda reasonable.
I had chem at ga-tech .. don't recall anything like passing at 50% retention though. Only took the first 2 chems. Wife did all the organic and physical etc classes. I lost interest when it stopped exploding.
That marks grading seen as low ! for reality is not true! it depends much on your academic level directly to the weight of your subject !
The premise of your question is slightly wrong because the question is not defined for mark = 70%.
Assuming a 70% is an A...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

#include <iostream>
#include <cmath>

int main()
{
    int num_candidates;
    std::cout << "Enter number of candidates: ";
    if (std::cin >> num_candidates)
        for (int i = 1; i <= num_candidates; i++)
        {
            int mark;
            std::cout << "Enter percentage mark: ";
            std::cin >> mark;
            std::cout << "#" << i << ": " << mark << " ("
                << static_cast<char>((4 - std::min(4, std::max(mark/10 - 3, 0)))*1.25+'A') << ")" << std::endl;
        }
}

Last edited on
Topic archived. No new replies allowed.