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> | |
// Car data (in a real app, this would come from a database) | |
const cars = [ | |
{ | |
id: 1, | |
name: "Toyota Corolla", | |
category: "Economy", | |
image: "/api/placeholder/300/200", | |
features: { | |
seats: 5, |
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> | |
<header> | |
<div class="container header-content"> | |
<div class="logo">SpeedyRent</div> | |
<nav> | |
<ul> | |
<li><a href="#home">Home</a></li> | |
<li><a href="#cars">Cars</a></li> | |
<li><a href="#locations">Locations</a></li> | |
<li><a href="#about">About</a></li> |
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> | |
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
} | |
body { | |
background-color: #f5f5f5; |
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
/* | |
În Java, o interfață este un tip de referință similar cu o clasă, dar care conține doar declarații de metode și constante, | |
fără implementare. Interfețele sunt folosite pentru a defini un "contract" pe care clasele care o implementează | |
trebuie să îl respecte. | |
*/ | |
public class Main { | |
public static void main(String[] args) { | |
System.out.println("===== FORME GEOMETRICE ====="); |
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
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
public class ColectiePersonalizata<T> implements Iterable<T> { | |
// Array pentru stocarea elementelor | |
private Object[] elemente; | |
private int dimensiune; | |
private static final int CAPACITATE_IMPLICITA = 10; | |
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
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
public class Main implements Iterator<Integer> { | |
private int[] data; | |
private int index = 0; | |
public Main(int[] data) { | |
this.data = data; | |
} |
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
Cele două interfețe au roluri complementare dar distincte în Java: | |
Interfața Iterable | |
------------------- | |
- Este definită în pachetul java.lang | |
- O clasă care implementează Iterable poate fi folosită direct în bucla for-each (enhanced for loop) | |
- Are o singură metodă obligatorie: Iterator<T> iterator() care returnează un obiect Iterator | |
- Este implementată de colecțiile standard din Java (ArrayList, HashSet, etc.) | |
- Reprezintă o colecție care poate fi parcursă |
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
cartItem.innerHTML = ` | |
<div class="item-info"> | |
<h3 class="item-title">${item.name}</h3> | |
<div class="item-price">$${item.price.toFixed(2)} each</div> | |
</div> | |
<div class="item-controls"> | |
<button class="decrease-quantity" data-id="${item.id}">-</button> | |
<span class="item-quantity">${item.quantity}</span> | |
<button class="increase-quantity" data-id="${item.id}">+</button> | |
<button class="remove-item" data-id="${item.id}" style="margin-left: 10px; background-color: #f44336;">×</button> |
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
document.querySelectorAll('.add-to-cart-button').forEach(button => { | |
button.addEventListener('click', addToCart); | |
}); | |
function afisare_produse() { | |
for (let i = 0; i < coffeeProducts.length; i++) { | |
const product = coffeeProducts[i]; | |
const create_product_card = document.createElement("div"); | |
create_product_card.classList.add("product-card"); |
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 WavFile extends SampledFile { | |
public WaveFile() { | |
super(); | |
} | |
public WavFile(String path) { | |
} |
NewerOlder