TYBsc Computer Science Solve PHP Slips - Internet Programming Slips | IProgramX

TYBCS IP SLIPS 10 Marks  



























                                               TYBCS IP SLIPS 20 Marks                                                                  

























Post a Comment

19 Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. give me zip file of this complete solution

    ReplyDelete
  3. Nice articel, This article help me very well. Thank you. Also please check my article on my site Know All About Deprecated: Non-Static Method Templates::Override_tax_template().

    ReplyDelete
  4. Phoenix Binary System is a professional Website Development Company in Anand Gujarat. Mobile App, SEO company in Anand, Web Design Company in Surat.

    ReplyDelete
  5. Nice Information... Thanks for this wonderful information..

    php classes in pune

    ReplyDelete
  6. Glad to find this. Your site very helpful and this post gives lots of information. Do share more updates.
    PHP Course in Chennai
    PHP Training Online
    PHP Course in Coimbatore

    ReplyDelete
  7. Thanks for sharing such a Excellent Blog! We are linking too this particularly great post on our site. Keep up the great writing.
    programming assignment help

    ReplyDelete
  8. Write the simulation program for demand paging and show the page
    scheduling and total number of page faults according the optimal page
    replacement algorithm. Assume the memory of n frames.
    Reference String : 8, 5, 7, 8, 5, 7, 2, 3, 7, 3, 5, 9, 4, 6, 2

    please sir we want code for this opt question.

    ReplyDelete
  9. #prime even odd

    def is_prime(n):
    if n < 2:
    return False
    for i in range(2, n):
    if n % i == 0:
    return False
    return True

    nums = [2, 3, 4, 9, 11, 15]

    for n in nums:
    if is_prime(n):
    print(n, "is Prime")
    elif n % 2 == 0:
    print(n, "is Even")
    else:
    print(n, "is Odd")

    ReplyDelete
  10. 2) Flatten a Nested List (Recursive)

    def flatten(lst):
    result = []
    for item in lst:
    if type(item) == list:
    result += flatten(item)
    else:
    result.append(item)
    return result

    print(flatten([1, [2, [3, 4], 5], 6]))

    ReplyDelete
  11. 3Arithmetic Calculator with Exception Handling

    try:
    a = float(input("Enter first number: "))
    b = float(input("Enter second number: "))
    op = input("Enter + - * / : ")

    if op == '+':
    print(a + b)
    elif op == '-':
    print(a - b)
    elif op == '*':
    print(a * b)
    elif op == '/':
    print(a / b)
    else:
    print("Invalid operator")
    except Exception as e:
    print("Error:", e)

    ReplyDelete
  12. 4...Bank Account Class

    class BankAccount:
    def __init__(self):
    self.balance = 0

    def deposit(self, amount):
    self.balance += amount

    def withdraw(self, amount):
    if amount <= self.balance:
    self.balance -= amount
    else:
    print("Not enough balance")

    def check_balance(self):
    print("Balance:", self.balance)

    acc = BankAccount()
    acc.deposit(1000)
    acc.check_balance()
    acc.withdraw(300)
    acc.check_balance()

    ReplyDelete
  13. 5......Vehicle, Car, Motorcycle (Method Overriding)

    class Vehicle:
    def describe(self):
    print("This is a vehicle")

    class Car(Vehicle):
    def describe(self):
    print("This is a car")

    class Motorcycle(Vehicle):
    def describe(self):
    print("This is a motorcycle")

    Car().describe()
    Motorcycle().describe()

    ReplyDelete
  14. 6) Extract Email Addresses (Regex)

    import re
    text = "Contact us at abc@example.com or support123@test1.org or hello@myemail123.com"
    emails = re.findall(r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9]+\.com", text)

    print(emails)

    ReplyDelete
  15. 7) Word Count Program

    sentence = input("Enter a sentence: ")

    words = sentence.lower().split()
    word_count = {}

    for word in words:
    if word in word_count:
    word_count[word] += 1
    else:
    word_count[word] = 1

    file = open("word_count.txt", "w")

    for word, count in word_count.items():
    file.write(word + " : " + str(count) + "\n")

    file.close()

    print("Word occurrences saved to word_count.txt")

    ReplyDelete
  16. 8) Student Management System (List & Dictionary)


    students = []

    def add_student():
    roll = input("Enter Roll No: ")
    name = input("Enter Name: ")
    marks = input("Enter Marks: ")
    student = {"roll": roll, "name": name, "marks": marks}
    students.append(student)
    print("Student added")

    def display_students():
    if not students:
    print("No records")
    return
    for s in students:
    print("Roll:", s["roll"], "Name:", s["name"], "Marks:", s["marks"])

    def search_student():
    roll = input("Enter Roll No to search: ")
    for s in students:
    if s["roll"] == roll:
    print("Roll:", s["roll"], "Name:", s["name"], "Marks:", s["marks"])
    return
    print("Student not found")

    def update_student():
    roll = input("Enter Roll No to update: ")
    for s in students:
    if s["roll"] == roll:
    s["name"] = input("Enter new name: ")
    s["marks"] = input("Enter new marks: ")
    print("Student updated")
    return
    print("Student not found")

    def delete_student():
    roll = input("Enter Roll No to delete: ")
    for s in students:
    if s["roll"] == roll:
    students.remove(s)
    print("Student deleted")
    return
    print("Student not found")

    while True:
    print("1.Add 2.Display 3.Search 4.Update 5.Delete 6.Exit")
    choice = input("Enter choice: ")

    if choice == "1":
    add_student()
    elif choice == "2":
    display_students()
    elif choice == "3":
    search_student()
    elif choice == "4":
    update_student()
    elif choice == "5":
    delete_student()
    elif choice == "6":
    break
    else:
    print("Invalid choice")

    ReplyDelete
  17. 9) CSV File – Calculate Average Marks

    file = open("marks.csv", "r")

    lines = file.readlines()
    file.close()

    total = 0
    count = 0

    for i in range(1, len(lines)):
    data = lines[i].strip().split(",")
    marks = int(data[1])
    total = total + marks
    count = count + 1

    average = total / count

    out = open("average.txt", "w")
    out.write("Average Marks = " + str(average))
    out.close()

    print("Average calculated and saved in average.txt")

    ReplyDelete
  18. 10) Student Management System using MongoDB


    from pymongo import MongoClient

    client = MongoClient("mongodb://localhost:27017/")
    db = client["MCA"]
    collection = db["student"]

    print("Connected to MongoDB")

    def add_student():
    roll = input("Enter Roll No: ")
    name = input("Enter Name: ")
    marks = input("Enter Marks: ")
    collection.insert_one({"id": roll, "name": name, "marks": marks})
    print("Student added")

    def display_students():
    data = collection.find({}, {"_id": 0})
    found = False
    for s in data:
    print("Roll:", s["id"], "Name:", s["name"], "Marks:", s["marks"])
    found = True
    if not found:
    print("No records found")

    def search_student():
    roll = input("Enter Roll No to search: ")
    s = collection.find_one({"id": roll}, {"_id": 0})
    if s:
    print("Roll:", s["id"], "Name:", s["name"], "Marks:", s["marks"])
    else:
    print("Student not found")

    def update_student():
    roll = input("Enter Roll No to update: ")
    name = input("Enter new name: ")
    marks = input("Enter new marks: ")
    result = collection.update_one({"id": roll}, {"$set": {"name": name, "marks": marks}})
    if result.matched_count:
    print("Student updated")
    else:
    print("Student not found")

    def delete_student():
    roll = input("Enter Roll No to delete: ")
    result = collection.delete_one({"id": roll})
    if result.deleted_count:
    print("Student deleted")
    else:
    print("Student not found")

    while True:
    print("1.Add 2.Display 3.Search 4.Update 5.Delete 6.Exit")
    choice = input("Enter choice: ")

    if choice == "1":
    add_student()
    elif choice == "2":
    display_students()
    elif choice == "3":
    search_student()
    elif choice == "4":
    update_student()
    elif choice == "5":
    delete_student()
    elif choice == "6":
    break
    else:
    print("Invalid choice")

    ReplyDelete