Write a Java application that computes and prints the grade of a student according to the following algorithm:

1) It should read from the user TMA score and MTA score.
2) If their sum is less than 15, the grade "FC" should be printed and the program will stop.
2b) Otherwise,
2b) It will read from the user final exam score.
- If it is less than 20, the grade "FF" should be printed and the program will stop.
- Otherwise,
- If the total score (sum of all scores) is less than 50, the grade "F" should be printed.
- Otherwise, the grade "P" should be printed

- All scores are real numbers
- You could assume that the user will insert valid scores

1 Year
Discussion Span
Last Post by JamesCherrill

That's just a copy of your assignment. Surely you didn't expect anyone to give you the solution? What help EXACTLY do you need?
What have you done so far?
Read the rules before continuing https://www.daniweb.com/community/rules

ps: Spec implies program will NOT stop if total score > 50. And the two "otherwise"s are redundant. Maybe whoever wrote that exercise needs to go a programming course themselves ;)

Edited by JamesCherrill


thanks for your reply


in the output print all grade what is the problem


You missed out the bits of the spec that said "and the program will stop".

You can make your program stop at any point by calling


there is a problem in my code becouse when i run the app and put the grade all grade printed !


Yes, I understood that from your previous post. I already explained why that happens, and gave you a HUGE hint as to how to fix it. Just re-read my previous post, and think.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.