Public synchronized int incContador (int val)

1

# Hw *8
addition = float(input(“Enter the annual addition of public residential land (in sq land):”))
years = 0 
current_total = initial_total 
while current_total < target_total:
    years += 1 
    private_residential = private_residential*1.03
    public_residential = public_residential + addition 
    current_total = private_residential + public_residential + rurual_settlement 

print(f”It will take at least {years} year(s) for the residential land in Hong Kong to double in size.”)

#cw

Read More

Essential Concepts in Big Data, AI, and Data Warehousing

Understanding RDD and Spark Operations

RDD (Resilient Distributed Dataset) is the fundamental data structure of Apache Spark. It is a fault-tolerant collection of elements distributed across multiple nodes in a cluster, designed for parallel processing.

Key Features of RDD

  • Distributed: Data is split across multiple machines.
  • Immutable: Once created, it cannot be changed.
  • Fault-tolerant: Lost data can be recomputed using lineage.
  • Lazy evaluation: Operations are executed only when needed.

RDD Operations

RDD

Read More

Data Link Layer Protocols and Switching Fundamentals

1. Elementary Data Link Protocols

Elementary Data Link Protocols are basic communication protocols used at the Data Link Layer of the OSI Model. They explain how data is transmitted between two devices and introduce concepts like flow control and error control in a simple way.

Types of Elementary Data Link Protocols

1. Unrestricted Simplex Protocol

  • Communication is one-way (simplex).
  • Sender continuously sends frames without waiting.
  • No error control or flow control.
  • Assumes receiver can handle all incoming
Read More

Computer Networking: Hardware, Software, and Models

Network Hardware and Software Essentials

Understanding the distinction between network hardware and network software is fundamental to grasping how modern communication systems function.

Network Hardware

Network hardware refers to the physical devices used to connect computers and other devices in a network to enable communication.

Key Components of Network Hardware

  • Computers/Nodes: Devices like PCs, laptops, and servers that send and receive data.
  • Network Interface Card (NIC): Allows a device to connect
Read More

Java System Design and Implementation Exercises

Experiment 2: Movie Ticket Booking System

Design and implement an Object-Oriented Movie Ticket Booking System using appropriate class relationships (association, aggregation, composition) to manage movies, shows, seats, and bookings.

import java.util.*;

class Seat {
    int seatNumber;
    boolean isAvailable;
    Seat(int num) {
        seatNumber = num;
        isAvailable = true;
    }
}

class Show {
    int showId;
    ArrayList<Seat> seats = new ArrayList<>();
    Show(int id, int 
Read More

Essential Python Programming Examples for Beginners

Unit Conversions

print("Select Conversion:")
print("1. Rupees to Dollar")
print("2. Celsius to Fahrenheit")
print("3. Inches to Feet")
choice = int(input("Enter your choice: "))
if choice == 1:
    rupees = float(input("Enter amount in Rupees: "))
    dollars = rupees / 83 # approx rate
    print("Amount in Dollars =", dollars)
elif choice == 2:
    c = float(input("Enter temperature in Celsius: "))
    f = (c * 9/5) + 32
    print("Temperature in Fahrenheit =", f)
elif choice == 3:
    inches = 
Read More