A program
A class has Random number of students....
They took an exam and got random scores from 1 to 100.

Write to the console:
the number of students in the classes
The number of students that passed (above 70)
The number of students that got average scores (between 50 and 69)
The number of students that failed
The scores of all the students....

Recommended Answers

All 2 Replies

Console.WriteLine is used to write in Console application.

What you need to do is, create an array of students using Math.Random

Use Math.Random to generate random number of students, then get there random passing marks from 1-100.

Then based on above data, calculate which array elements have above 40 score, that is total number of students passed.

Similarly, count for total students failed and total of students above 60 score.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.