GoConqr has a new look! Let us know what you think.

Module 12 of 18 · Media

Selling ice-cream exercise

Kostas Diakogiannis

Selling ice-cream exercise

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.

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?