Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Library Management System | Section
Fundamental Data Structures in Java

bookChallenge: Library Management System

Tehtävä

Swipe to start coding

Your task is to complete the Library class by filling in the missing parts:

  1. addBook(Book book) method:

    • Add the given book to the books list.
  2. findBooksByAuthor(String author) method:

    • Iterate over all Book objects in the books list.
    • For each book, check if its author matches the given author.
    • If it matches, add the book to a temporary list called result.
    • After the loop, return the result list.
  3. displayAllBooks() method:

    • Iterate over all Book objects in the books list.
    • For each book, print its ID, title, and author in a readable format.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 3
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

bookChallenge: Library Management System

Pyyhkäise näyttääksesi valikon

Tehtävä

Swipe to start coding

Your task is to complete the Library class by filling in the missing parts:

  1. addBook(Book book) method:

    • Add the given book to the books list.
  2. findBooksByAuthor(String author) method:

    • Iterate over all Book objects in the books list.
    • For each book, check if its author matches the given author.
    • If it matches, add the book to a temporary list called result.
    • After the loop, return the result list.
  3. displayAllBooks() method:

    • Iterate over all Book objects in the books list.
    • For each book, print its ID, title, and author in a readable format.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 3
single

single

some-alt