Previous Next
0 / 15
Module DEMO-33-69DEMO-OOP-33

Delivery Route Manifest

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create two Java files: Main.java and RouteManifest.java.

Read the required values, construct a RouteManifest object, and print a multiline report.

The report must contain these lines in this order:

  1. Package
  2. Weight
  3. Shipping Total

Use a constructor and keep the object-oriented structure clear.

Input Format

Input is provided as separate whitespace-separated tokens in the same order described in the problem statement.

Output Format

Print the exact multiline report required by the question.

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
PK1
2.5
1.2
3.0
Package: PK1
Weight: 2.50
Shipping Total: 6.00
Input: package code = "PK1", weight in kg = 2.5, price per kg = 1.2, zone fee = 3.0.
Key calculation(s): "Package: " + "PK1" = "Package: PK1" | "Weight: " + String.format("%.2f", 2.5) = "Weight: 2.50".
Output:
Package: PK1
Weight: 2.50
Shipping Total: 6.00
Sample #2
Public sample
PK2
5.0
0.8
1.5
Package: PK2
Weight: 5.00
Shipping Total: 5.50
Input: package code = "PK2", weight in kg = 5.0, price per kg = 0.8, zone fee = 1.5.
Key calculation(s): "Package: " + "PK2" = "Package: PK2" | "Weight: " + String.format("%.2f", 5.0) = "Weight: 5.00".
Output:
Package: PK2
Weight: 5.00
Shipping Total: 5.50

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings