Skip to content

Exercise

What to do?

  1. Jack is running a lemonade stand. He sells cups of lemonade for $2 each. Customers can buy multiple cups at once. Jack wants to know how much money he made. Ask the user for the number of cups of lemonade sold. Calculate and display the total earnings.
  2. Sarah is planting flowers in her garden. She wants to create rows of flowers, with 6 flowers in each row. She needs to know how many rows she can make with the given number of flowers. Request the user input for the total number of flowers. Calculate and show the number of rows that can be formed.
  3. Emma is organizing a pizza party. Each pizza can feed 8 people. She needs to know how many pizzas to order based on the number of guests attending. Ask the user for the total number of guests expected. Compute and display the number of pizzas needed for the party.
  4. Lisa is at a bookstore offering a 25% discount on books. She wants to know the discounted price of a book she wishes to purchase. Request the user input for the original price of the book. Calculate and show the discounted price after applying the 25% discount.
  5. A library has a system where books are borrowed for a specific duration, and a late fee is charged for overdue books. The library charges a late fee for every day a book is returned late. Today is Monday, and we want to determine which day it will be after a certain number of days. Ask the user to input a number. Then, find out which day it will be after the number of days specified by the user.