HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


050. 50566 - Grade Point Average (GPA)

Guest
• Discussion of problem (1)

Volume problems

• 50539 - Number of Chairs - 2
• 003. 50432 - Numbers and Squares
• 004. 50433 - Sum of Cubes
• 005. 50595 - Sum of the numbers
• 016. 50459 - The Biggest Digit
• 020. 50575 - Number of Prime num...
• 030. 50576 - Number of Perfect nu...
• 050. 50510 - What floor are they?
• 050. 50566 - Grade Point Aver...
• 066. 50523 - Total Tax to Pay
• 070. 50534 - Top Trading Company
• 095. 50453 - The Cubic Difference
• 125. 50578 - Mersenne prime
• 132. 50474 - Sum of Two Primes
• 165. 50577 - Perfect Numbers and ...
• 190. 50533 - Contacts List
• 200. 50454 - What day is it?

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Grade Point Average (GPA)

Shqip

While spending the summer as an assistant at Epoka university, your professor asked you to write a program that will take average grades (over 100) for a student and calculate his/her GPA.

100-grades are converted to letter grades as in the following table.

Grade Letter Grade GPA value
  From        To   
0 49 FF 0
50 59 FD 0.5
60 64 DD 1
65 69 DC 1.5
70 74 CC 2
75 79 CB 2.5
80 84 BB 3
85 89 BA 3.5
90 100 AA 4

Write a program that will read as many as average grades over 100 from the input, and then, calculate and show the average GPA for the given student.

Note: When converting the marks into Grade Points, every mark is converted separately. Then, their sum and finally the average are calculated

Input specification
There will be a series of integer numbers between 0 ≤ n ≤ 1000 followed by a negative number.

Output specification
If any of the given numbers is greater than 100 show a message "IMPROPER INPUT". Otherwise, calculate corresponding Grade Point Value and then show the cumulative Grade Point Average.
If the result is a whole number show with no decimal places. Otherwise, show with at most two decimal places. That is, the number will be rounded to the nearest 100th digit, if it has more than two digits.

Input I
45 30 -2
Output 1
0
     
Input 2
20 82 71 -5
Output 2
1.67
     
Input 3
20 500 70 80 -1
Output 3
IMPROPER INPUT

Для отправки решений необходимо выполнить вход.

www.contester.ru