Unit 3: Database Interaction and CodeIgniter Framework

Unit 3: Database Interaction and CodeIgniter Framework Database Interaction and CodeIgniter Framework NOTES 3.1 PHP with MySQL/MongoDB Introduction to PHP PHP (Hypertext Preprocessor) is a server-side scripting language used to create dynamic and interactive web pages. It is widely used with databases to store, retrieve, and manage data. Server-side: Code is executed on the server. […]

Write a Python program to enter P, T, R and calculate Simple Interest.

Write a Python program to enter P, T, R and calculate Simple Interest. PROGRAM https://youtu.be/V2YVAR9nDj8?list=PLzyEFfpN3YawUfVOgviI7CggbNW434dqU # Input principal, time and rateP = float(input(“Enter the Principal amount (P): “))T = float(input(“Enter the Time in years (T): “))R = float(input(“Enter the Rate of interest (R): “)) # Calculate Simple InterestSI = (P * T * R) / […]

Write a Python program to enter marks of five subjects and calculate total, average and percentage.

Write a Python program to enter marks of five subjects and calculate total, average and percentage. PROGRAM https://youtu.be/V2YVAR9nDj8?list=PLzyEFfpN3YawUfVOgviI7CggbNW434dqU # Input marks of five subjectsmark1 = float(input(“Enter marks of Subject 1: “))mark2 = float(input(“Enter marks of Subject 2: “))mark3 = float(input(“Enter marks of Subject 3: “))mark4 = float(input(“Enter marks of Subject 4: “))mark5 = float(input(“Enter marks […]

Write a Python program to calculate area of an equilateral triangle.

Write a Python program to calculate area of an equilateral triangle. PROGRAM https://youtu.be/V2YVAR9nDj8?list=PLzyEFfpN3YawUfVOgviI7CggbNW434dqU import math # Input the side of the equilateral triangleside = float(input(“Enter the side of the equilateral triangle: “)) # Calculate the areaarea = (math.sqrt(3) / 4) * side * side # Display the resultprint(f”The area of the equilateral triangle is: {area:.2f} […]

Write a Python program to enter base and height of a triangle and find its area.

Write a Python program to enter base and height of a triangle and find its area. PROGRAM https://youtu.be/V2YVAR9nDj8?list=PLzyEFfpN3YawUfVOgviI7CggbNW434dqU # Python program to find the area of a triangle # Input base and height from the userbase = float(input(“Enter the base of the triangle: “))height = float(input(“Enter the height of the triangle: “)) # Calculate areaarea […]

Write a Python program to enter two angles of a triangle and find the third angle.

Write a Python program to enter two angles of a triangle and find the third angle. PROGRAM https://youtu.be/V2YVAR9nDj8?list=PLzyEFfpN3YawUfVOgviI7CggbNW434dqU # Python program to find the third angle of a triangle (no if-else) # Input two angles from the userangle1 = float(input(“Enter the first angle of the triangle: “))angle2 = float(input(“Enter the second angle of the triangle: […]

Write a Python program to enter any number and calculate its square root.

Write a Python program to enter any number and calculate its square root. PROGRAM https://youtu.be/V2YVAR9nDj8?list=PLzyEFfpN3YawUfVOgviI7CggbNW434dqU import math # Input from the usernum = float(input(“Enter any number: “)) # Check if the number is non-negativeif num >= 0:sqrt = math.sqrt(num)print(f”The square root of {num} is: {sqrt}”)else:print(“Square root of negative number is not defined in real numbers.”) […]

Write a Python program to find power of any number x ^ y.

Write a Python program to find power of any number x ^ y. PROGRAM https://youtu.be/V2YVAR9nDj8?list=PLzyEFfpN3YawUfVOgviI7CggbNW434dqU # Python program to find power of any number (x ^ y) # Input from the userx = float(input(“Enter the base number (x): “))y = float(input(“Enter the exponent (y): “)) # Calculate powerresult = x ** y # Display the […]

Write a Python program to convert days into years, weeks and days.

Write a Python program to convert days into years, weeks and days. PROGRAM https://youtu.be/nBezzJDpVlY?list=PLzyEFfpN3YawUfVOgviI7CggbNW434dqU # Python program to convert days into years, weeks, and days # Input: Total number of daystotal_days = int(input(“Enter total number of days: “)) # Calculate years, weeks, and remaining daysyears = total_days // 365remaining_days = total_days % 365 weeks = […]