Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
Write a Prolog code
that accepts input of CGPA from user and determines the level

      of that CGPA; > 0 and <
2.00 as "poor", >= 2.00 and < 3.00 as "good" and >= 3.00 as

      "excellent". The example of
output for the Prolog code is as follows:



 ?- run.

Enter your CGPA: 1.60.

Your CGPA is poor.



?- run.

Enter your CGPA: 2.00.

Your CGPA is good.



?- run.

Enter your CGPA: 3.80.

Your CGPA is
excellent.
Posted

1 solution

XML
CGPA; > 0 and <
2.00 as "poor", >= 2.00 and < 3.00 as "good" and >= 3.00 as

      "excellent". The example of
output for the Prolog code is as follows:



 ?- run.

Enter your CGPA: 1.60.

Your CGPA is poor.



?- run.

Enter your CGPA: 2.00.

Your CGPA is good.



?- run.

Enter your CGPA: 3.80.

Your CGPA is
excellent.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900