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

Shipping Fee Band

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read a package weight and print the shipping fee according to the required weight bands.

Input Format

Input is given as whitespace-separated tokens in this order:

  1. package weight

Output Format

Print the exact report in this order:

  1. Fee

Sample Testcases

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

Sample #1
Public sample
0.5
Fee: 2.00
Input: package weight = 0.5.
Key calculation(s): double fee | if (0.5 <= 1.0) { | "Fee: " + String.format("%.2f", fee) = "Fee: 2.00".
Output:
Fee: 2.00
Sample #2
Public sample
3.2
Fee: 4.50
Input: package weight = 3.2.
Key calculation(s): double fee | if (3.2 <= 1.0) { | "Fee: " + String.format("%.2f", fee) = "Fee: 4.50".
Output:
Fee: 4.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