This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //abstract product | |
| abstract class Transport { | |
| protected String cargo; | |
| protected String destination; | |
| public void setCargo(String cargo) { | |
| this.cargo = cargo; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Modelul de Design Factory este un model creational care ofera o interfata pentru crearea obiectelor intr-o superclasa, dar permite | |
| subclaselor sa modifice tipul obiectelor care vor fi create. Acest model este deosebit de util cand avem nevoie de un mod de a crea | |
| diferite obiecte, dar dorim sa separam codul clientului de clasele concrete | |
| */ | |
| abstract class Document { | |
| protected String name; | |
| protected String content; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| themeToggle.addEventListener('click', () => { | |
| const html = document.documentElement; | |
| const currentTheme = html.getAttribute('data-theme'); | |
| const newTheme = currentTheme === 'light' ? 'dark' : 'light'; | |
| html.setAttribute('data-theme', newTheme); | |
| // Update the button icon | |
| if (newTheme === 'dark') { | |
| moonIcon.style.display = 'none'; | |
| sunIcon.style.display = 'block'; | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <body> | |
| <div class="container"> | |
| <header class="header"> | |
| <h1>Coffee Shop</h1> | |
| <p>Select your favorite coffee and add it to cart</p> | |
| </header> | |
| <main class="products" id="products-container"> | |
| <!-- Products will be added here by JavaScript --> | |
| </main> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| // Coffee products data | |
| const coffeeProducts = [ | |
| { | |
| id: 1, | |
| name: "Espresso", | |
| price: 2.99, | |
| description: "Strong and concentrated coffee shot" | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <style> | |
| body { | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| line-height: 1.6; | |
| color: #333; | |
| background-color: #f5f5f5; | |
| margin: 0; | |
| padding: 20px; | |
| } | |
| .container { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SampledFile extends AudioFile { | |
| protected long duration; | |
| public SampledFile() { | |
| super(); | |
| this.duration = 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package player; | |
| import java.util.Map; | |
| public class TaggedFile extends SampleFile { | |
| private String album; | |
| public void readAndStoreTags() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TestFormeGeometrice { | |
| public static void main(String[] args) { | |
| FormaGeometrica cerc = new Cerc("rosu",5.5); | |
| FormaGeometrica dreptunghi = new Dreptunghi("albastru", 3.0, 5.0); | |
| System.out.println("Detalli despre Cerc:"); | |
| cerc.afiseazaDetalii(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Cerc extends FormaGeometrica { | |
| private double raza; | |
| public Cerc(String culoare, double raza) { | |
| //super apeleaza constructorul clasei de baza | |
| //FormaGeometrica(culoare) | |
| super( culoare ); |