Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Projects

Todo List

In this project we will create a todolist application

Create a class
TodoItem with a field

  • task

TodoList with methods

  • add - give an error if an item already exists
  • list - give an error if the list has more then 10 items
  • delete - give an error if an item does not exist

Add a priority to the TodoItem

if the same item is added keep the one with the highest priority and sort the list on priority

Create a main method that tests the todo list.

Shopping basket

In this project we will create a shoppingbasket application Create the classes

Article with the fields

  • name
  • price

ShoppingBasket with the methods

  • add - give an error if an article already exists

  • list - give an error if the list has no items

  • delete - give an error if an item does not exist

  • filter on prices between an low and high value

Add an amount field to the article Sort the list alphabetically Sort the list on alphabet and amount

Create a main method that tests the shopping basket.