obrazky
-
  1. Create a program that works with the file books.json and allows you to:
  • display all books

  • search for books by author

  • search for books by year of publication

  • search for books by part of the title

  • display books that have more than 300 pages

  • sort books by title (alphabetically)

      [
          {"title": "1984", "author": "George Orwell", "year": 1949, "pages": 328},
          {"title": "Malý princ", "author": "Antoine de Saint-Exupéry", "year": 1943, "pages": 96},
          {"title": "Harry Potter a Kameň mudrcov", "author": "J.K. Rowling", "year": 1997, "pages": 309},
          {"title": "Pán prsteňov", "author": "J.R.R. Tolkien", "year": 1954, "pages": 423},
          {"title": "Hobit", "author": "J.R.R. Tolkien", "year": 1937, "pages": 310}
      ]
    
  1. Create a program that works with the file products.json and allows you to:
  • display all products

  • search for a product by name

  • search for products cheaper than a given price

  • search for products by category

  • display products that are in stock (stock > 0)

  • sort products by price (from the cheapest)

      [
          {"name": "Notebook", "price": 1200, "category": "electronics", "stock": 5},
          {"name": "Mouse", "price": 25, "category": "electronics", "stock": 50},
          {"name": "T-shirt", "price": 15, "category": "clothing", "stock": 0},
          {"name": "Shoes", "price": 80, "category": "clothing", "stock": 12},
          {"name": "Phone", "price": 900, "category": "electronics", "stock": 8}
      ]
    
  1. Create a system for company employees, where is a base class Employee and derived classes Manager and Developer. The Employee class contains the attributes name, age, and salary. The Manager class will additionally have a list of subordinates, and the Developer class will include the programming language they work in.

  2. Create a base class Vehicle and derived classes Car and Bike.

    • The Car class will additionally have the attribute num_doors (number of doors).
    • The Bike class will have the attribute has_engine (whether it has an engine).
    • Each class will override the display_info() method to display specific information.
  3. Create a base class Product and derived classes Electronics and Clothing.

    • Electronics will have a warranty in months.
    • Clothing will have size and material.
    • Each class will override the display_info() method to display relevant information.
  4. Create a base class Ticket and derived classes BusTicket and TrainTicket.

    • BusTicket will include a destination and trip type (one-way/round-trip).
    • TrainTicket will include class (1st class / 2nd class) and the option to reserve a seat.
    • Each class will override the display_info() method to display relevant information.
-
Copyright © 2008-2026 Miroslava Valíková