Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

D2 - Ice Cream exercise

 

Suppose that you are working by an ice cream shop, that has waffles where you can put from 1 up to 5 balls.

Write a program that reads the number of ice creams balls the customer wants and stores it to a variable. Then calculates the cost accordingly. The prices are the following:

1 ball: 1$

2 balls: 1,8$

3 balls: 2,5$

4 balls: 3$

5 balls: 3,30$

If no balls is specified by the customer the default should be the price for 2 balls.

Print the correct price to the console at the end.