A text file, grades.txt, contains data pertaining to student grades. Each line consists of:

student number,course mark1, course mark2, course mark3, course mark4

The last line contains a student number 0 to indicate the end of the data.
Write a C program to print a grade report, as outlined below, to the file report.txt.

For each student, output the student number, the marks obtained in each course, followed by the final mark of the student(average of all the marks) and their grades (A,B,C,D or F). At the end of the report output the number of students in the file, the average final mark, and the student with the highest final mark.

Grades are to be calculates as follows:

A: 70 and over
B: 60-70(exclusive)
C: 50-60(exclusive)
D: 40-50(exclusive)
F: less than 40

Anny ideas anyone???

TrustyTony commented: No proper effort shown -3

Recommended Answers

All 2 Replies

By now, people should realize that we are not here to help you cheat on your homework! Try to solve the problems first, and then we MIGHT decide to help you sort out your problems... :-(

commented: I guess we all need walt-p's boiler plate +10

As per request, one boilerplate answer coming up:

First off, we don't do other people's homework for them. Second, we don't do other people's homework for them. And third, we don't do other people's homework for them. Sensing a pattern here yet?

No one here will simply hand you a solution on a silver platter. If you show us what you've done, what you've tried to do, and what problems you've had with it, then we'll be happy to help. If you have specific questions, we can answer them, or at least point you in the right direction. If you have a program with a bug you can't swat on your own, we'll be glad to assist, so long as you pay attention to the forum rules and post sensible questions in an intelligent manner that we have some reasonable hope of answering.

But just cutting and pasting an assignment into a message, without even prefacing it with something like, "I have this homework problem that I can't solve...", is likely to get you booted from the message boards here and elsewhere - if you're lucky. What happens to you if you are unlucky is... well... let's just say that this guy probably won't be trying that again, on that forum or this one.

And in case you think you won't get caught... think again.

We take this issue seriously here. Very seriously. Asking us to do homework for you is a grave breach of academic ethics on your part, and actually doing so would be an even bigger breach on ours (not that this stops the many fine mercenaries at vWorker and Scriptlance, but still). Simply posting this here, in this way, could get you expelled from your school, if someone happens to notice it and blow the whistle on you. Furthermore, it does neither you nor us any good to help you cheat - especially since there's a good chance some day one of us will have to work with you, manage you, or, Eris forefend, fix code you've written. We have an obligation to our profession and our own future sanity to help you become a good programmer, and doing your coursework for you isn't going to do that.

The problem description is somewhat daunting, I have to admit, but even for a beginning student, it shouldn't be too difficult. Post what you've already tried and we'll look at it, but please don't just dump your problems in our laps like this.

commented: Loved the thread about "this guy"! :-) +12
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.