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

Restaurant Combo Price

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Read a combo size (S, M, or L) and a delivery flag. Print the total price.

Input Format

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

  1. meal size
  2. delivery flag

Output Format

Print the exact report in this order:

  1. Total

Sample Testcases

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

Sample #1
Public sample
S
0
Total: 4.00
Input: meal size = "S", delivery flag = 0.
Key calculation(s): double price | price = 4.0 | "Total: " + String.format("%.2f", price) = "Total: 4.00".
Output:
Total: 4.00
Sample #2
Public sample
M
1
Total: 8.50
Input: meal size = "M", delivery flag = 1.
Key calculation(s): double price | price = 4.0 | "Total: " + String.format("%.2f", price) = "Total: 8.50".
Output:
Total: 8.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