The document outlines a series of programming assignments, each requiring the implementation of specific functions. These include finding the maximum of three numbers, identifying triangle types, checking leap years, calculating sums of digits, and more. Each assignment specifies input requirements and expected output for clarity.
The document outlines a series of programming assignments, each requiring the implementation of specific functions. These include finding the maximum of three numbers, identifying triangle types, checking leap years, calculating sums of digits, and more. Each assignment specifies input requirements and expected output for clarity.
1. Find the maximum of three Input: numbers Write a program that takes three numbers as input and finds the ?- max_of_three. maximum. Enter first number: 3. Enter second number: 7. Enter third number: 5. Output: Maximum is: 7 2. Identify a triangle type Input: Write a program that takes three sides ?- triangle_type. of a triangle and determines its type. Enter first side: 5. Enter second side: 5. Enter third side: 5. Output: Equilateral Triangle 3. Check if a year is a leap year Input: Write a program that checks if a given ?- check_leap_year. year is a leap year. Enter a year: 2024. Output: 2024 is a Leap Year. 4. Find the sum of digits of a number Input: Write a program that takes a number as input and calculates the sum of its ?- calculate_sum_digits. digits. Enter a number: 1234. Output: Sum of digits: 10. 5. Check if a person is an adult Input: Write a program that determines if a ?- check_adult. person is an adult based on their age. Enter name: John. Enter age: 22. Output: John is an adult. 6. Convert Celsius to Fahrenheit Input: Write a program that converts a temperature from Celsius to ?- celsius_to_fahrenheit. Fahrenheit. Enter temperature in Celsius: 25. Output: Temperature in Fahrenheit: 77. 7. Calculate Simple Interest Input: Write a program that takes principal, rate, and time to compute simple ?- simple_interest. interest. Enter principal amount: 1000. Enter rate of interest: 5. Enter time (years): 2. Output: Simple Interest: 100.0 8. Find the GCD of two numbers Input: Write a program to compute the greatest common divisor of two ?- calculate_gcd. numbers. Enter first number: 48. Enter second number: 18. Output: GCD of 48 and 18 is 6. 9. Compute power of a number (X^N) Input: using recursion ?- power. Write a program that takes X and N as Enter base: 2. input and computes X raised to the Enter exponent: 3. power N using recursion. Output: Result: 8. 10. Sum of first N natural numbers Input: Write a program that takes N as input ?- sum_natural. and computes the sum of first N Enter a number: 5. numbers recursively. Output: Sum: 15.
11. Find the nth Fibonacci number Input:
Write a program that takes a number ?- nth_fibonacci. and finds the corresponding Fibonacci Enter the position: 6. number. Output: Fibonacci number at position 6 is 8. Input: 12. Check if a word is a palindrome ?- palindrome. Write a program that checks whether Enter a word: radar. a given word is a palindrome. Output: radar is a palindrome.
Solution Manual by General Chemistry The Essential Concepts 7th Edition by Chang and Goldsby ISBN 0073402753 9780073402758 - Download Now For An Unlimited Reading Experience