← Unit 1 · all exercises
Saved in this browser only

A tiny receipt

Print three lines: the item name, then "Price: " and the price, then the word Thanks. For "Tea" and 250, print exactly: Tea Price: 250 Thanks

void receipt(String item, int price)

Solution.java
Loading editor…
Results

Examples

  • receipt(Tea, 250) → Tea Price: 250 Thanks
  • receipt(Book, 1200) → Book Price: 1200 Thanks

There are also 2 hidden tests you can't see. Solve the problem, not the examples.