Page 1 of 1

1 Replies - 302 Views - Last Post: 04 May 2013 - 08:40 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=320318&amp;s=384a836d250e79b2c44e0ff0599f46df&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#1 hansma

Reputation: -3
• Posts: 10
• Joined: 04-May 13

Posted 04 May 2013 - 08:34 PM

Im a little new to the programming and i was wondering if anyone could show me a code for this?

Write a program that asks the user to enter the number of students he/she wishes to calculate exam grades for. You will use this value create an array of scores. Have the user enter the scores for each student, storing these values in an array.

The letter grades will be determined by the scores entered. The highest score will be an A, any score within 10 points of the highest score will also be an A, and so on, based on the table below:

Grade is A if score is => best - 10
Grade is B if score is => best - 20
Grade is C if score is => best - 30
Grade is D if score is => best - 40
Grade is F for any score less than D.

Display the scores and letter grades as entered:

Student 1 score is 66.0 and grade is C
Student 2 score is 88.0 and grade is A
Student 3 score is 77.0 and grade is B
Student 4 score is 56.0 and grade is D

Now, I need to sort the grades AND display the scores associated to these students from highest to lowest, as in:

Student 2 score is 88.0 and grade is A
Student 3 score is 77.0 and grade is B
Student 1 score is 66.0 and grade is C
Student 4 score is 56.0 and grade is D

Is This A Good Question/Topic? 0

Replies To: Program that displays letter grades?

#2 modi123_1

• Suitor #2

Reputation: 10143
• Posts: 38,863
• Joined: 12-June 08

Re: Program that displays letter grades?

Posted 04 May 2013 - 08:40 PM

Do not open duplicate topics. Closing