<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Group Activity CCS3101 by Shafinah Kamarudin</title>
      <link>https://padlet.com/shafinah1/ccs3101</link>
      <description></description>
      <language>en-us</language>
      <pubDate>2025-05-19 00:57:17 UTC</pubDate>
      <lastBuildDate>2025-06-17 05:08:25 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>Group Member</title>
         <author>shafinah1</author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456251848</link>
         <description><![CDATA[<p>Group 1:</p><p>1.ABANG</p><p>2.SHARVESSH</p><p>3.RAJ</p><p>4.DAMIA</p><p>5.ISHA</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 01:37:18 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456251848</guid>
      </item>
      <item>
         <title>Group 2</title>
         <author>shafinah1</author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456252570</link>
         <description><![CDATA[<p>Group2:</p><p>1. ZHAO CHENBO  227220</p><p>2. ⁠LI RONG 226816</p><p>3. ⁠ZHONG ZIHANG 227210</p><p>4. ⁠GUO GAOMING 226246</p><p>5. ⁠SHU QI 226972</p><p>6. Zhang tengyin 227184</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 01:37:44 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456252570</guid>
      </item>
      <item>
         <title>Group 3</title>
         <author>shafinah1</author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456252964</link>
         <description><![CDATA[<p>Group 3:</p><p>1. Nazira</p><p>2. ⁠Ghaidaa</p><p>3. ⁠Ayuni</p><p>4. ⁠Farah</p><p>5. ⁠Najla</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 01:37:59 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456252964</guid>
      </item>
      <item>
         <title>Group 4</title>
         <author>shafinah1</author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456253705</link>
         <description><![CDATA[<p>Group 4 </p><p>1.Akmal </p><p>2.Ikmal</p><p>3.Mirzan</p><p>4.Wan Harith</p><p>5.Zhang Yunhe</p><p>6Dai Shangxi</p><p><br></p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 01:38:22 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456253705</guid>
      </item>
      <item>
         <title>Group 5</title>
         <author>shafinah1</author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456256118</link>
         <description><![CDATA[<p>Group 5:</p><p>1. Izzah</p><p>2. Filza</p><p>3. Alfian</p><p>4. Iman</p><p>5. Hazim</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 01:39:41 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456256118</guid>
      </item>
      <item>
         <title>Group 6</title>
         <author>shafinah1</author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456256841</link>
         <description><![CDATA[<p>Group 6:</p><p>1. Sharman</p><p>2. Navein </p><p>3. Manish</p><p>4. Ravi Dhanis Al Fayad</p><p>5. Ahda Dzia Ulhaq</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 01:40:00 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456256841</guid>
      </item>
      <item>
         <title>Question </title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456364094</link>
         <description><![CDATA[<p>Question Title: Abstract Class in Employee Salary System</p><p><br/></p><p>You are required to design a simple employee management system using abstract classes and inheritance.</p><p><br/></p><p>1. Create an abstract class named Employee with the following:</p><ul><li><p>Private attributes: name (String) and id (int)</p></li><li><p>A constructor to initialize the attributes</p></li></ul><ul><li><p>Getter and setter methods for both attributes</p></li><li><p>A toString() method that returns a string with the employee’s name and ID</p></li><li><p>An abstract method named calculateSalary() that returns a double</p></li></ul><p>2. Create a subclass named FullTimeEmployee that extends Employee, and:</p><ul><li><p>Add a private attribute: monthlySalary (double)</p></li><li><p>Provide constructor, getter, and setter for monthlySalary</p></li><li><p>Implement the calculateSalary() method (which just returns the monthly salary)</p></li><li><p>Override the toString() method to also include the monthly salary</p><p><br/></p></li></ul><p>3. In your main method (inside TestEmployee class), create an object of FullTimeEmployee and display:</p><ul><li><p>The result of the toString() method</p></li><li><p>The result of the calculateSalary() method</p></li></ul>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 02:31:36 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456364094</guid>
      </item>
      <item>
         <title>Question</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456410562</link>
         <description><![CDATA[<p>You are required to write a program of a simple payment processing system using interface classes. The program must have : </p><ul><li><p>Interface class</p></li><li><p>Classes for the payment methods</p></li></ul><p>In some of these classes there will be several methods including getter,setter and toString() method.  The interface class will be the superclass.</p><p><br></p><p>For the main method, ask the user for input and display the results.</p><p><br></p><p><br></p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 02:53:34 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456410562</guid>
      </item>
      <item>
         <title></title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456410604</link>
         <description><![CDATA[<p>package JavaActivity;</p><p>// Abstract class</p><p>abstract class Employee {</p><p>    // Attributes</p><p>    private String name;</p><p>    private int id;</p><p>    // Constructor</p><p>    public Employee(String name, int id) {</p><p>        <a rel="noopener noreferrer nofollow" href="http://this.name">this.name</a> = name;</p><p>        <a rel="noopener noreferrer nofollow" href="http://this.id">this.id</a> = id;</p><p>    }</p><p>    // Abstract method</p><p>    public abstract double calculateSalary();</p><p>    // Getter and Setter</p><p>    public String getName() {</p><p>        return name;</p><p>    }</p><p>    public void setName(String name) {</p><p>        <a rel="noopener noreferrer nofollow" href="http://this.name">this.name</a> = name;.</p><p>    }</p><p>    public int getId() {</p><p>        return id;</p><p>    }</p><p>    public void setId(int id) {</p><p>        <a rel="noopener noreferrer nofollow" href="http://this.id">this.id</a> = id;</p><p>    }</p><p>    // toString method</p><p>    public String toString() {</p><p>        return "Employee Name: " + name + ", ID: " + id;</p><p>    }</p><p>}</p><p>// Concrete subclass</p><p>class FullTimeEmployee extends Employee {</p><p>    private double monthlySalary;</p><p>    public FullTimeEmployee(String name, int id, double monthlySalary) {</p><p>        super(name, id);</p><p>        this.monthlySalary = monthlySalary;</p><p>    }</p><p>    // Implement abstract method</p><p>    public double calculateSalary() {</p><p>        return monthlySalary;</p><p>    }</p><p>    // Getter and Setter</p><p>    public double getMonthlySalary() {</p><p>        return monthlySalary;</p><p>    }</p><p>    public void setMonthlySalary(double monthlySalary) {</p><p>        this.monthlySalary = monthlySalary;</p><p>    }</p><p>    // Override toString to include salary</p><p>    public String toString() {</p><p>        return super.toString() + ", Monthly Salary: RM" + monthlySalary;</p><p>    }</p><p>}</p><p>// Main class</p><p>public class TestEmployee {</p><p>    public static void main(String[] args) {</p><p>        FullTimeEmployee emp1 = new FullTimeEmployee("Adam Hakimi", 101, 3000.0);</p><p>        System.out.println(emp1.toString());</p><p>        System.out.println("Calculated Salary: RM" + emp1.calculateSalary());</p><p>    }</p><p>}</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 02:53:35 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456410604</guid>
      </item>
      <item>
         <title></title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456411604</link>
         <description><![CDATA[<p><br/></p><p><br/></p>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/3858363684/ed47579be2fad51b2f6b5755d2fe77a6/WhatsApp_Image_2025_05_19_at_10_31_41_e2aaf7be.jpg" />
         <pubDate>2025-05-19 02:54:01 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456411604</guid>
      </item>
      <item>
         <title>Question</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456427441</link>
         <description><![CDATA[<p>Design an object-oriented system to model a simple animal hierarchy using <strong>abstract classes</strong>, <strong>inheritance</strong>, <strong>method overriding</strong>, <strong>constructors</strong>, <strong>getters/setters</strong>, and the <strong>toString()</strong> method.</p><p>You are required to complete the following tasks:</p><p><strong>   1.Create an abstract class Animal</strong> with:</p><ul><li><p>Private fields: name (String), age (int)</p></li><li><p>Constructor to initialize name and age</p></li><li><p>Abstract method: makeSound()</p></li><li><p>Concrete method: eat() that prints "[name] is eating."</p></li><li><p>Getter and setter methods for all fields</p></li><li><p>Override the toString() method to return:<br>"Animal[name=..., age=...]"</p><p>2.<strong>Create two subclasses: Dog and Cat</strong> that extend Animal:</p><ul><li><p>Dog should have an additional field: breed (String)</p></li><li><p>Cat should have an additional field: color (String)</p></li><li><p>Both subclasses must override the makeSound() method:</p><ul><li><p>Dog: prints "Woof!"</p></li><li><p>Cat: prints "Meow!"</p></li></ul></li><li><p>Both subclasses must override toString() and include their own additional fields using super.toString()</p><p>3.<strong>Create a class AnimalTest</strong> that:</p><ul><li><p>Creates a Cat object and a Dog object (using Animal as the reference type)</p></li><li><p>Calls their eat(), makeSound(), and toString() methods</p></li><li><p>Prints the results to the console</p></li></ul></li></ul></li></ul>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 03:00:55 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456427441</guid>
      </item>
      <item>
         <title>Question</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456433682</link>
         <description><![CDATA[<p>Question: Create a Java program that simulates an employee management system. Your solution must include: </p><p>• An abstract class Employee with common attributes (name, salary) and an abstract method calculateBonus(). </p><p>• Two subclasses: FullTimeEmployee and PartTimeEmployee, which extend Employee and implement calculateBonus() differently. </p><p>• Each class must have multiple methods related to their behavior. </p><p>• Include constructors (with and without arguments). </p><p>• Include getter and setter methods. </p><p>• Override the toString() method to display employee details. </p><p>• Create a Department class that uses composition or aggregation to relate to multiple Employee objects like this</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 03:03:39 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456433682</guid>
      </item>
      <item>
         <title>Sample output</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456439575</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/3858350571/46398a490912f276322493dbd1db5bdf/WhatsApp___2025_05_19_11_02_41_c354a12b.jpg" />
         <pubDate>2025-05-19 03:06:15 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456439575</guid>
      </item>
      <item>
         <title>code</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456445414</link>
         <description><![CDATA[<p>public abstract class Animal { </p><p>private String name; </p><p>private int age; </p><p>// Construct Methods</p><p>public Animal(String name, int age) { this.name = name; this.age = age; }</p><p> // Abstract Methods</p><p> public abstract void makeSound();</p><p> // Regular Methods</p><p>public void eat() { </p><p>System.out.println(name + " is eating."); </p><p>} </p><p>// Getter and Setter </p><p>public String getName() { return name; </p><p>} </p><p>public void setName(String name) { this.name = name; }</p><p> public int getAge() { return age; } public void setAge(int age) { this.age = age; </p><p>} </p><p>// toString Method </p><p>@Override</p><p>public String toString() { </p><p>return "Animal[name=" + name + ", age=" + age + "]"; } </p><p>}</p><p>public class Dog extends Animal {</p><p>    private String breed;</p><p>    public Dog(String name, int age, String breed) {</p><p>        super(name, age);</p><p>        this.breed = breed;</p><p>    }</p><p>    @Override</p><p>    public void makeSound() {</p><p>        System.out.println("Woof!");</p><p>    }</p><p>    public String getBreed() {</p><p>        return breed;</p><p>    }</p><p>    public void setBreed(String breed) {</p><p>        this.breed = breed;</p><p>    }</p><p>    @Override</p><p>    public String toString() {</p><p>        return super.toString() + ", breed=" + breed;</p><p>    }</p><p>}</p><p>public class Cat extends Animal {</p><p>    private String color;</p><p>    public Cat(String name, int age, String color) {</p><p>        super(name, age);</p><p>        this.color = color;</p><p>    }</p><p>    @Override</p><p>    public void makeSound() {</p><p>        System.out.println("Meow!");</p><p>    }</p><p>    public String getColor() {</p><p>        return color;</p><p>    }</p><p>    public void setColor(String color) {</p><p>        this.color = color;</p><p>    }</p><p>    @Override</p><p>    public String toString() {</p><p>        return super.toString() + ", color=" + color;</p><p>    }</p><p>}</p><p>public class AnimalTest {</p><p>    public static void main(String[] args) {</p><p>        Animal cat = new Cat("Mimi", 2, "White");</p><p>        Animal dog = new Dog("Buddy", 4, "Golden Retriever");</p><p>        <a rel="noopener noreferrer nofollow" href="http://cat.eat">cat.eat</a>();</p><p>        cat.makeSound();</p><p>        System.out.println(cat.toString());</p><p>        <a rel="noopener noreferrer nofollow" href="http://dog.eat">dog.eat</a>();</p><p>        dog.makeSound();</p><p>        System.out.println(dog.toString());</p><p>    }</p><p>}</p><p><br></p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 03:08:44 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456445414</guid>
      </item>
      <item>
         <title>Question</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456456228</link>
         <description><![CDATA[<p><br></p><p>Scenario:</p><p>You are hired to design a Payment Processing System. The system must handle different types of payments such as Credit Card, PayPal, and Crypto Payment. All payment methods must provide a processPayment() method to handle the payment. Each payment method should store and manage the payer’s name.</p><p>---</p><p>Requirements:</p><p>1. Define an interface PaymentMethod with the method processPayment(double amount).</p><p>2. Create a superclass Payer with:</p><p>A private attribute name.</p><p>A no-argument constructor that sets the name to "Unknown".</p><p>A constructor with an argument to set the payer’s name.</p><p>Getter and setter for the name attribute.</p><p>A toString() method that returns "Payer Name: &lt;name&gt;".</p><p>3. Create two subclasses that extend Payer and implement PaymentMethod:</p><p>CreditCardPayment</p><p>PayPalPayment</p><p>4. In each subclass:</p><p>Override processPayment(double amount) to display a message like:</p><p>"Processing Credit Card payment of $&lt;amount&gt; by &lt;payer name&gt;".</p><p>Override toString() to include the payer name and the payment method.</p><p>5. Write a PaymentDemo class to:</p><p>Create a CreditCardPayment object with the payer name "Alice".</p><p>Create a PayPalPayment object with the payer name "Bob".</p><p>Process payments of $150.75 for Alice and $99.99 for Bob.</p><p>Display the toString() details for both.</p><p>---</p><p>Expected Output:</p><p>Processing Credit Card payment of $150.75 by Alice</p><p>Processing PayPal payment of $99.99 by Bob</p><p>Payer Name: Alice, Payment Method: Credit Card</p><p>Payer Name: Bob, Payment Method: PayPal</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 03:14:04 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456456228</guid>
      </item>
      <item>
         <title>Question</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456456676</link>
         <description><![CDATA[<p>You are required to design a Supermarket Inventory System using Object-Oriented Programming in Java.</p><p><br></p><ul><li><p>Create an abstract class called Product with the following:</p></li></ul><p>Protected variables: String name, double price, int quantity</p><p><br></p><ul><li><p>A constructor with arguments to initialize the variables</p></li></ul><p>Abstract method: double calculateTotalPrice()</p><p><br></p><ul><li><p>A regular method: void displayInfo()</p></li></ul><p>Getter and Setter methods for all variables</p><p>toString() method to show product info in a readable format</p><p><br></p><ul><li><p>Create a subclass called PerishableProduct that extends Product and adds:</p></li></ul><p>One more variable: int expiryDays</p><p>A constructor that uses super(...) to call the parent class</p><p><br></p><ul><li><p>Getter and Setter for expiryDays</p></li></ul><p>Override the calculateTotalPrice() method:</p><p>If expiryDays &lt;= 3, give a 20% discount</p><p><br></p><ul><li><p>Otherwise, no discount</p></li></ul><p>Create a Main class to:</p><p>Create one object of PerishableProduct</p><p>Display all product information using toString() and displayInfo()</p><p><br></p><ul><li><p>Show the total price after discount using calculateTotalPrice()</p></li></ul>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 03:14:19 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456456676</guid>
      </item>
      <item>
         <title></title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456467593</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/3858557208/8b295b9479f1f0eeb15d7e0756e6f17a/__2025_05_19_11_19_06.png" />
         <pubDate>2025-05-19 03:19:22 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456467593</guid>
      </item>
      <item>
         <title>Code</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456469226</link>
         <description><![CDATA[<p>package HelloWorld;</p><p><br></p><p>import java.util.ArrayList;</p><p>import java.util.List;</p><p>import java.util.Scanner;</p><p><br></p><p>// Abstract Superclass</p><p>abstract class Employee {</p><p>    protected String name;</p><p>    protected double salary;</p><p><br></p><p>    public Employee() {}</p><p><br></p><p>    public Employee(String name, double salary) {</p><p>        <a rel="noopener noreferrer nofollow" href="http://this.name">this.name</a> = name;</p><p>        this.salary = salary;</p><p>    }</p><p><br></p><p>    public abstract double calculateBonus();</p><p><br></p><p>    public String getName() { return name; }</p><p>    public void setName(String name) { <a rel="noopener noreferrer nofollow" href="http://this.name">this.name</a> = name; }</p><p>    public double getSalary() { return salary; }</p><p>    public void setSalary(double salary) { this.salary = salary; }</p><p><br></p><p>    public String toString() {</p><p>        return "Name: " + name + "\nSalary: RM" + salary;</p><p>    }</p><p>}</p><p><br></p><p>// Full-Time Employee</p><p>class FullTimeEmployee extends Employee {</p><p>    private int yearsOfService;</p><p><br></p><p>    public FullTimeEmployee() {}</p><p><br></p><p>    public FullTimeEmployee(String name, double salary, int yearsOfService) {</p><p>        super(name, salary);</p><p>        this.yearsOfService = yearsOfService;</p><p>    }</p><p><br></p><p>    public int getYearsOfService() { return yearsOfService; }</p><p>    public void setYearsOfService(int yearsOfService) { this.yearsOfService = yearsOfService; }</p><p><br></p><p>    <em>@Override</em></p><p>    public double calculateBonus() {</p><p>        return 0.10 <em> salary </em> yearsOfService;</p><p>    }</p><p><br></p><p>    public void applyLeave(int days) {</p><p>        System.<strong><em>out</em></strong>.println(name + " applied for " + days + " days of leave.");</p><p>    }</p><p><br></p><p>    <em>@Override</em></p><p>    public String toString() {</p><p>        return super.toString() + "\nType: Full-Time\nBonus: RM" + calculateBonus();</p><p>    }</p><p>}</p><p><br></p><p>// Part-Time Employee</p><p>class PartTimeEmployee extends Employee {</p><p>    private int hoursWorked;</p><p><br></p><p>    public PartTimeEmployee() {}</p><p><br></p><p>    public PartTimeEmployee(String name, double salary, int hoursWorked) {</p><p>        super(name, salary);</p><p>        this.hoursWorked = hoursWorked;</p><p>    }</p><p><br></p><p>    public int getHoursWorked() { return hoursWorked; }</p><p>    public void setHoursWorked(int hoursWorked) { this.hoursWorked = hoursWorked; }</p><p><br></p><p>    <em>@Override</em></p><p>    public double calculateBonus() {</p><p>        return 10.0 * hoursWorked;</p><p>    }</p><p><br></p><p>    public void logHours(int hours) {</p><p>        System.<strong><em>out</em></strong>.println(name + " logged " + hours + " extra hours.");</p><p>    }</p><p><br></p><p>    <em>@Override</em></p><p>    public String toString() {</p><p>        return super.toString() + "\nType: Part-Time\nBonus: RM" + calculateBonus();</p><p>    }</p><p>}</p><p><br></p><p>// Department Class</p><p>class Department {</p><p>    private String departmentName;</p><p>    private List&lt;Employee&gt; employees;</p><p><br></p><p>    public Department(String departmentName) {</p><p>        this.departmentName = departmentName;</p><p>        this.employees = new ArrayList&lt;&gt;();</p><p>    }</p><p><br></p><p>    public void addEmployee(Employee e) {</p><p>        employees.add(e);</p><p>    }</p><p><br></p><p>    public void showAllEmployees() {</p><p>        System.<strong><em>out</em></strong>.println("\nDepartment: " + departmentName);</p><p>        for (Employee e : employees) {</p><p>            System.<strong><em>out</em></strong>.println("---------------------");</p><p>            System.<strong><em>out</em></strong>.println(e.toString());</p><p>        }</p><p>    }</p><p>}</p><p><br></p><p>// Main Class</p><p>public class oopLabActivity {</p><p>    public static void main(String[] args) {</p><p>        Scanner scanner = new Scanner(<a rel="noopener noreferrer nofollow" href="http://System.in">System.<strong><em>in</em></strong></a>);</p><p>        Department dept = new Department("IT");</p><p><br></p><p>        System.<strong><em>out</em></strong>.print("How many employees do you want to enter? ");</p><p>        int numEmployees = scanner.nextInt();</p><p>        scanner.nextLine(); // consume newline</p><p><br></p><p>        for (int i = 1; i &lt;= numEmployees; i++) {</p><p>            System.<strong><em>out</em></strong>.println("\nEnter details for employee #" + i);</p><p>            System.<strong><em>out</em></strong>.print("Enter name: ");</p><p>            String name = scanner.nextLine();</p><p><br></p><p>            System.<strong><em>out</em></strong>.print("Enter salary: RM");</p><p>            double salary = scanner.nextDouble();</p><p>            scanner.nextLine();</p><p><br></p><p>            System.<strong><em>out</em></strong>.print("Is the employee Full-Time or Part-Time? (F/P): ");</p><p>            String type = scanner.nextLine().trim().toUpperCase();</p><p><br></p><p>            if (type.equals("F")) {</p><p>                System.<strong><em>out</em></strong>.print("Enter years of service: ");</p><p>                int years = scanner.nextInt();</p><p>                scanner.nextLine(); // consume newline</p><p>                FullTimeEmployee fte = new FullTimeEmployee(name, salary, years);</p><p>                dept.addEmployee(fte);</p><p>            } else if (type.equals("P")) {</p><p>                System.<strong><em>out</em></strong>.print("Enter hours worked: ");</p><p>                int hours = scanner.nextInt();</p><p>                scanner.nextLine(); // consume newline</p><p>                PartTimeEmployee pte = new PartTimeEmployee(name, salary, hours);</p><p>                dept.addEmployee(pte);</p><p>            } else {</p><p>                System.<strong><em>out</em></strong>.println("Invalid type. Skipping this employee.");</p><p>            }</p><p>        }</p><p><br></p><p>        // Display employees</p><p>        dept.showAllEmployees();</p><p><br></p><p>        scanner.close();</p><p>    }</p><p>}</p><p><br></p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 03:20:15 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456469226</guid>
      </item>
      <item>
         <title>Output</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456470889</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/3858471397/762060b2e394f12233351d0b07430589/WhatsApp_Image_2025_05_19_at_10_49_53_e15cc4b3.jpg" />
         <pubDate>2025-05-19 03:21:13 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456470889</guid>
      </item>
      <item>
         <title></title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456472873</link>
         <description><![CDATA[<p>package tryAbstract;</p><p>import java.util.Scanner;</p><p>import java.util.ArrayList;</p><p><br></p><p><br></p><p>abstract class Product {</p><p>    protected String name;</p><p>    protected double price;</p><p>    protected int quantity;</p><p><br></p><p>    public Product(String name, double price, int quantity) {</p><p>        <a rel="noopener noreferrer nofollow" href="http://this.name">this.name</a> = name;</p><p>        this.price = price;</p><p>        this.quantity = quantity;</p><p>    }</p><p><br></p><p>    public abstract double calculateTotalPrice();</p><p><br></p><p>    public void displayInfo() {</p><p>        System.<strong><em>out</em></strong>.println("\nProduct Info:");</p><p>        System.<strong><em>out</em></strong>.println("Name: " + name);</p><p>        System.<strong><em>out</em></strong>.println("Price: RM" + price);</p><p>        System.<strong><em>out</em></strong>.println("Quantity: " + quantity);</p><p>    }</p><p>    public String getName() {</p><p>        return name;</p><p>    }</p><p><br></p><p>    public void setName(String name) {</p><p>        <a rel="noopener noreferrer nofollow" href="http://this.name">this.name</a> = name;</p><p>    }</p><p><br></p><p>    public double getPrice() {</p><p>        return price;</p><p>    }</p><p><br></p><p>    public void setPrice(double price) {</p><p>        this.price = price;</p><p>    }</p><p><br></p><p>    public int getQuantity() {</p><p>        return quantity;</p><p>    }</p><p><br></p><p>    public void setQuantity(int quantity) {</p><p>        this.quantity = quantity;</p><p>    }</p><p><br></p><p>}</p><p><br></p><p>class PerishableProduct extends Product {</p><p>    private int expiryDays;</p><p><br></p><p>    public PerishableProduct(String name, double price, int quantity, int expiryDays) {</p><p>        super(name, price, quantity);</p><p>        this.expiryDays = expiryDays;</p><p>    }</p><p><br></p><p>    <em>@Override</em></p><p>    public double calculateTotalPrice() {</p><p>        double total = price * quantity;</p><p>        if (expiryDays &lt;= 7) {</p><p>            total *= 0.5;</p><p>        } else {</p><p>            total *= 0.8;</p><p>        }</p><p>        return total;</p><p>    }</p><p><br></p><p>    <em>@Override</em></p><p>    public String toString() {</p><p>        return super.toString() + "\nExpiry in: " + expiryDays + " days";</p><p>    }</p><p>}</p><p><br></p><p>public class firstTry {</p><p>    public static void main(String[] args) {</p><p>        Scanner input = new Scanner(<a rel="noopener noreferrer nofollow" href="http://System.in">System.<strong><em>in</em></strong></a>);</p><p>        ArrayList&lt;PerishableProduct&gt; inventory = new ArrayList&lt;&gt;();</p><p>        String choice;</p><p><br></p><p>        do {</p><p>            System.<strong><em>out</em></strong>.print("Enter product name: ");</p><p>            String name = input.nextLine();</p><p><br></p><p>            System.<strong><em>out</em></strong>.print("Enter product price: ");</p><p>            double price = input.nextDouble();</p><p><br></p><p>            System.<strong><em>out</em></strong>.print("Enter quantity: ");</p><p>            int quantity = input.nextInt();</p><p><br></p><p>            System.<strong><em>out</em></strong>.print("Enter days until expiry: ");</p><p>            int expiryDays = input.nextInt();</p><p>            input.nextLine();</p><p><br></p><p>            PerishableProduct product = new PerishableProduct(name, price, quantity, expiryDays);</p><p>            inventory.add(product);</p><p><br></p><p>            System.<strong><em>out</em></strong>.print("\nDo you want to add another item? (y/n): ");</p><p>            choice = input.nextLine().toLowerCase();</p><p><br></p><p>        } while (choice.equals("y"));</p><p><br></p><p>        // === Inventory Output ===</p><p>        double grandTotal = 0;</p><p>        int totalItems = 0;</p><p><br></p><p>        System.<strong><em>out</em></strong>.println("\n=== Inventory Details ===");</p><p><br></p><p>        for (PerishableProduct item : inventory) {</p><p>            System.<strong><em>out</em></strong>.println("\n--- Product: " + item.getName() + " ---");</p><p>            item.displayInfo();</p><p>            double itemTotal = item.calculateTotalPrice();</p><p>            System.<strong><em>out</em></strong>.printf("Total price for this item: RM%.2f\n", itemTotal);</p><p>            grandTotal += itemTotal;</p><p>            totalItems += item.quantity;</p><p>        }</p><p><br></p><p>        // === Final Summary ===</p><p>        System.<strong><em>out</em></strong>.println("\n=== Purchase Summary ===");</p><p>        System.<strong><em>out</em></strong>.println("Total number of items bought: " + totalItems);</p><p>        System.<strong><em>out</em></strong>.printf("Total price for all items: RM%.2f\n", grandTotal);</p><p><br></p><p>        input.close();</p><p>    }</p><p>}</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 03:22:22 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456472873</guid>
      </item>
      <item>
         <title>Coding</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456488322</link>
         <description><![CDATA[<p><br></p><p>import java.util.Scanner;</p><p><br></p><p>interface PaymentInterface {</p><p> </p><p> void makePayment();</p><p><br></p><p> String getPaymentDetails();</p><p>}</p><p><br></p><p>class CreditCardPayment implements PaymentInterface {</p><p> </p><p> private double amount;</p><p><br></p><p> private String cardNumber;</p><p><br></p><p> public CreditCardPayment(double amount, String cardNumber) {</p><p>    </p><p>     if (amount &lt;= 0) {</p><p>         throw new IllegalArgumentException("Amount must be positive.");</p><p>     }</p><p>     </p><p>     if (cardNumber == null || cardNumber.length() &lt; 5) {</p><p>         throw new IllegalArgumentException("Invalid credit card number.");</p><p>     }</p><p>     </p><p>     this.amount = amount;</p><p>     this.cardNumber = cardNumber;</p><p> }</p><p><br></p><p> public double getAmount() {</p><p>     return amount;</p><p> }</p><p> </p><p> public void setAmount(double amount) {</p><p>     if (amount &lt;= 0) {</p><p>         throw new IllegalArgumentException("Amount must be positive.");</p><p>     }</p><p>     this.amount = amount;</p><p> }</p><p> </p><p> public String getCardNumber() {</p><p>     return cardNumber;</p><p> }</p><p> </p><p> public void setCardNumber(String cardNumber) {</p><p>     this.cardNumber = cardNumber;</p><p> }</p><p><br></p><p> public void makePayment() {</p><p>     System.out.println("Paid $" + amount + " using Credit Card ending with " +</p><p>             cardNumber.substring(cardNumber.length() - 4));</p><p> }</p><p> </p><p> public String getPaymentDetails() {</p><p>     return "Credit Card Payment of $" + amount;</p><p> }</p><p> </p><p> public String toString() {</p><p>     return "CreditCardPayment{amount=$" + amount + ", cardNumber=" +</p><p>             cardNumber.substring(cardNumber.length() - 4) + "}";</p><p> }</p><p>}</p><p><br></p><p>class PayPalPayment implements PaymentInterface {</p><p>amount</p><p> private double amount;</p><p><br></p><p> private String email;</p><p><br></p><p> public PayPalPayment(double amount, String email) {</p><p>     if (amount &lt;= 0) {</p><p>         throw new IllegalArgumentException("Amount must be positive.");</p><p>     }</p><p>     if (email == null || !email.contains("@")) {</p><p>         throw new IllegalArgumentException("Invalid PayPal email.");</p><p>     }</p><p>     this.amount = amount;</p><p>     <a rel="noopener noreferrer nofollow" href="http://this.email">this.email</a> = email;</p><p> }</p><p><br></p><p> public double getAmount() {</p><p>     return amount;</p><p> }</p><p><br></p><p> public void setAmount(double amount) {</p><p>     if (amount &lt;= 0) {</p><p>         throw new IllegalArgumentException("Amount must be positive.");</p><p>     }</p><p>     this.amount = amount;</p><p> }</p><p><br></p><p> public String getEmail() {</p><p>     return email;</p><p> }</p><p><br></p><p> public void setEmail(String email) {</p><p>     <a rel="noopener noreferrer nofollow" href="http://this.email">this.email</a> = email;</p><p> }</p><p> </p><p> public void makePayment() {</p><p>     System.out.println("Paid $" + amount + " using PayPal account: " + email);</p><p> }</p><p><br></p><p> public String getPaymentDetails() {</p><p>     return "PayPal Payment of $" + amount;</p><p> }</p><p><br></p><p> public String toString() {</p><p>     return "PayPalPayment{amount=$" + amount + ", email=" + email + "}";</p><p> }</p><p>}</p><p><br></p><p>public class PaymentApp12 {</p><p><br></p><p> public static void main(String[] args) {</p><p>     </p><p>     Scanner scanner = new Scanner(<a rel="noopener noreferrer nofollow" href="http://System.in">System.in</a>);</p><p>     try {</p><p>        </p><p>         System.out.print("Enter payment method (credit/paypal): ");</p><p>         String method = scanner.nextLine().toLowerCase();</p><p>         </p><p>         System.out.print("Enter payment amount: ");</p><p>         double amount = scanner.nextDouble();</p><p>         scanner.nextLine(); // consume newline</p><p>         </p><p>         PaymentInterface payment;</p><p>         </p><p>         if (method.equals("credit")) {</p><p>             System.out.print("Enter credit card number: ");</p><p>             String cardNumber = scanner.nextLine();</p><p>             payment = new CreditCardPayment(amount, cardNumber);</p><p>         }</p><p>        </p><p>         else if (method.equals("paypal")) {</p><p>             System.out.print("Enter PayPal email: ");</p><p>             String email = scanner.nextLine();</p><p>             payment = new PayPalPayment(amount, email);</p><p>         }</p><p>         </p><p>         else {</p><p>             throw new IllegalArgumentException("Unsupported payment method.");</p><p>         }</p><p>        </p><p>         System.out.println("\n--- Payment Summary ---");</p><p>         </p><p>         payment.makePayment();</p><p>        </p><p>         System.out.println(payment.toString());</p><p>         </p><p>         System.out.println("Details: " + payment.getPaymentDetails());</p><p>     } catch (IllegalArgumentException e) {</p><p>         // Handle input errors such as invalid amount or method</p><p>         System.out.println("Input error: " + e.getMessage());</p><p>     } catch (Exception e) {</p><p>         // Handle other unexpected exceptions</p><p>         System.out.println("Unexpected error: " + e.getMessage());</p><p>     }</p><p>    </p><p>     scanner.close();</p><p> }</p><p>}</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 03:31:22 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456488322</guid>
      </item>
      <item>
         <title></title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456490802</link>
         <description><![CDATA[<p>public interface PaymentMethod {</p><p>    void processPayment(double amount);</p><p>}</p><p>public class Payer {</p><p>    private String name;</p><p>    // No-arg constructor</p><p>    public Payer() {</p><p>        <a rel="noopener noreferrer nofollow" href="http://this.name">this.name</a> = "Unknown";</p><p>    }</p><p>    // Constructor with argument</p><p>    public Payer(String name) {</p><p>        <a rel="noopener noreferrer nofollow" href="http://this.name">this.name</a> = name;</p><p>    }</p><p>    // Getter</p><p>    public String getName() {</p><p>        return name;</p><p>    }</p><p>    // Setter</p><p>    public void setName(String name) {</p><p>        <a rel="noopener noreferrer nofollow" href="http://this.name">this.name</a> = name;</p><p>    }</p><p>    // toString method</p><p>    public String toString() {</p><p>        return "Payer Name: " + name;</p><p>    }</p><p>}</p><p>public class CreditCardPayment extends Payer implements PaymentMethod {</p><p>    public CreditCardPayment(String name) {</p><p>        super(name);</p><p>    }</p><p>    @Override</p><p>    public void processPayment(double amount) {</p><p>        System.out.println("Processing Credit Card payment of $" + amount + " by " + getName());</p><p>    }</p><p>    @Override</p><p>    public String toString() {</p><p>        return super.toString() + ", Payment Method: Credit Card";</p><p>    }</p><p>}</p><p>public class PayPalPayment extends Payer implements PaymentMethod {</p><p>    public PayPalPayment(String name) {</p><p>        super(name);</p><p>    }</p><p>    @Override</p><p>    public void processPayment(double amount) {</p><p>        System.out.println("Processing PayPal payment of $" + amount + " by " + getName());</p><p>    }</p><p>    @Override</p><p>    public String toString() {</p><p>        return super.toString() + ", Payment Method: PayPal";</p><p>    }</p><p>}</p><p>public class PaymentDemo {</p><p>    public static void main(String[] args) {</p><p>        CreditCardPayment alicePayment = new CreditCardPayment("Alice");</p><p>        PayPalPayment bobPayment = new PayPalPayment("Bob");</p><p>        alicePayment.processPayment(150.75);</p><p>        bobPayment.processPayment(99.99);</p><p>        System.out.println(alicePayment.toString());</p><p>        System.out.println(bobPayment.toString());</p><p>    }</p><p>}</p><p><br></p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-19 03:32:40 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456490802</guid>
      </item>
      <item>
         <title>Output</title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3456491373</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/3858303980/3483aaf72dafcf3a1ea0551d86035f1b/WhatsApp_Image_2025_05_19_at_11_32_29.jpeg" />
         <pubDate>2025-05-19 03:33:02 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3456491373</guid>
      </item>
      <item>
         <title></title>
         <author></author>
         <link>https://padlet.com/shafinah1/ccs3101/wish/3466838776</link>
         <description><![CDATA[<p>public interface PaymentMethod {</p><p><br></p><p>    void processPayment(double amount);</p><p><br></p><p>}</p><p><br></p><p>public class Payer {</p><p><br></p><p>    private String name;</p><p><br></p><p>    // No-arg constructor</p><p><br></p><p>    public Payer() {</p><p><br></p><p>        this.name = "Unknown";</p><p><br></p><p>    }</p><p><br></p><p>    // Constructor with argument</p><p><br></p><p>    public Payer(String name) {</p><p><br></p><p>        this.name = name;</p><p><br></p><p>    }</p><p><br></p><p>    // Getter</p><p><br></p><p>    public String getName() {</p><p><br></p><p>        return name;</p><p><br></p><p>    }</p><p><br></p><p>    // Setter</p><p><br></p><p>    public void setName(String name) {</p><p><br></p><p>        this.name = name;</p><p><br></p><p>    }</p><p><br></p><p>    // toString method</p><p><br></p><p>    public String toString() {</p><p><br></p><p>        return "Payer Name: " + name;</p><p><br></p><p>    }</p><p><br></p><p>}</p><p><br></p><p>public class CreditCardPayment extends Payer implements PaymentMethod {</p><p><br></p><p>    public CreditCardPayment(String name) {</p><p><br></p><p>        super(name);</p><p><br></p><p>    }</p><p><br></p><p>    @Override</p><p><br></p><p>    public void processPayment(double amount) {</p><p><br></p><p>        System.out.println("Processing Credit Card payment of $" + amount + " by " + getName());</p><p><br></p><p>    }</p><p><br></p><p>    @Override</p><p><br></p><p>    public String toString() {</p><p><br></p><p>        return super.toString() + ", Payment Method: Credit Card";</p><p><br></p><p>    }</p><p><br></p><p>}</p><p><br></p><p>public class PayPalPayment extends Payer implements PaymentMethod {</p><p><br></p><p>    public PayPalPayment(String name) {</p><p><br></p><p>        super(name);</p><p><br></p><p>    }</p><p><br></p><p>    @Override</p><p><br></p><p>    public void processPayment(double amount) {</p><p><br></p><p>        System.out.println("Processing PayPal payment of $" + amount + " by " + getName());</p><p><br></p><p>    }</p><p><br></p><p>    @Override</p><p><br></p><p>    public String toString() {</p><p><br></p><p>        return super.toString() + ", Payment Method: PayPal";</p><p><br></p><p>    }</p><p><br></p><p>}</p><p><br></p><p>public class PaymentDemo {</p><p><br></p><p>    public static void main(String[] args) {</p><p><br></p><p>        CreditCardPayment alicePayment = new CreditCardPayment("Alice");</p><p><br></p><p>        PayPalPayment bobPayment = new PayPalPayment("Bob");</p><p><br></p><p>        alicePayment.processPayment(150.75);</p><p><br></p><p>        bobPayment.processPayment(99.99);</p><p><br></p><p>        System.out.println(alicePayment.toString());</p><p><br></p><p>        System.out.println(bobPayment.toString());</p><p><br></p><p>    }</p><p><br></p><p>}</p><p><br></p><p><br></p>]]></description>
         <enclosure url="" />
         <pubDate>2025-05-26 03:25:19 UTC</pubDate>
         <guid>https://padlet.com/shafinah1/ccs3101/wish/3466838776</guid>
      </item>
   </channel>
</rss>
