Java Week 3 Graded Programming Assignment Solutions

In , On October 12, 2025 Brand:
Purchase this product now and earn 3 Boost Points!

Description

☕ Java Week 3 Graded Programming Assignment Solutions

Versions: v1_t12024, v2_t12025 —
Complete executable Java code implementations covering Inheritance, Polymorphism, and Encapsulation with Banking/Geometric models.

This downloadable bundle provides the complete, required Java code implementations for the three Graded Programming Assignments (GrPA) in Week 3. The solutions focus on implementing correct OOP structures to satisfy polymorphism, method overriding, and constructor chaining requirements.


GrPA 1: Inheritance and Polymorphism (Person/Employee/ContactEmployee)

This assignment focuses on constructor chaining and method overriding:

  • Inheritance Structure: Implement Employee (inherits Person) and ContactEmployee (inherits Employee).
  • Constructor Chaining: The Employee constructor must call the Person constructor using super() to initialize inherited fields (name, aadharno).
  • Calculated Field: The ContactEmployee constructor must calculate the salary based on contactHour * hourlyPay before calling super() to pass the salary to the Employee superclass constructor.
  • Method Overriding: The Employee.print() method must override Person.print() and call super.print() to include inherited details before printing the salary.

GrPA 2: Runtime Polymorphism and instanceof (Shape/Rectangle/Cube)

This assignment demonstrates dynamic method dispatch and runtime type checking:

  • Method Overriding: Implement area() and volume() methods in Rectangle and Cube subclasses, overriding the default implementations in the Shape class.
  • Constructors: Implement constructors for Rectangle (w, h) and Cube (a) to initialize private dimensions.
  • Polymorphic Caller: Implement the static method FClass.caller(Shape s) to demonstrate runtime behavior:
    • If s is a Rectangle (checked using instanceof), print the result of s.area().
    • If s is a Cube, print the result of s.volume().

GrPA 3: Encapsulation and Banking Logic (BankAccount)

This assignment focuses on controlled data access and method structure:

  • Final/Private Fields: Define the final minimum balance and implement a private method checkMinBalance(amount) to enforce the minimum balance rule before any withdrawal.
  • Encapsulated Withdrawal: The public withdraw(int amt) method must call checkMinBalance(). It only proceeds with balance -= amt if the check returns true; otherwise, it prints “Transaction failed”.

Additional information

Java

Week 3 GrPA Solution

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Product Details

₹100.00

Purchase this product now and earn 3 Boost Points!

Product Information

  • Price
    :

    ₹100.00

  • Released
    :

    October 12, 2025

  • Last Updated
    :

    May 15, 2026

  • File Included
    :

    PDF

  • File Size
    :

    3 MB

  • Compatible With
    :

    Java Week 3 GrPA

  • Version
    :

    v3-t12026

Your'e ViewingJava Week 3 Graded Programming Assignment Solutions

₹100.00

Purchase this product now and earn 3 Boost Points!