Question: Design Prolog Programs for the following. Q 1 . To test whether given numbers are pythagorean triple. Eg: Input: ? - is _ triple (
Design Prolog Programs for the following.
Q To test whether given numbers are pythagorean triple.
Eg: Input: istriple
Output: true
Q Find if given numbers are coprime.
Eg: Input: coprime
Output: true
Q Check whether given numbers form a geometric sequence.
Eg: Input: isgeometricsequence
Output: true
Q Write a Prolog program that asks the user for their birth year and calculates and prints their age:
Eg: Input: age
Enter your birth year:
Output: You are years old.
Q Check a Prolog program that prompts the user to enter their Employee ID and displays their de
partment based on a predefined database. If the entered Employee ID is incorrect ie not found in
the database the program should prompt the user to enter the Employee ID again until a valid one
is entered.
Use the following predefined employee database:
Employee ID belongs to the "manager" department.
Employee ID belongs to the hr department.
Eg: Input: getdept
Enter your Employee ID:
Output: Your Employee ID is and you belong to the department:
manager
Input: getdept
Enter your Employee ID:
Output: Incorrect Employee id enter again.
Enter your Employee ID:
Your Employee ID is and you belong to the department:
manager
please dont use chatgpt or any other plagarism websites explain clearly
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
