i = 1;
while(i < n) {
j = 0;
while(j < n) {
cnt = cnt + 1;
j = j + i;
}
i = 2 * i;
}
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
<?php | |
// Set sendmail_from address explicitly to ensure the correct "From" address | |
ini_set('sendmail_from', '[email protected]'); | |
// 1. Define recipient email, subject, and "From" address | |
$to = "[email protected]"; // Replace with the recipient's email address | |
$subject = "New Contact Form Submission"; | |
$from = "[email protected]"; // Specify the "From" email address | |
// 2. Collect form 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Contact Form</title> | |
</head> | |
<body> | |
<form action="contact.php" method="POST"> | |
<label for="name">Name:</label> | |
<input type="text" id="name" name="name" required><br><br> |
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
<?php | |
$to = '[email protected]'; | |
$subject = 'Test mail'; | |
$message = 'Aceasta este o scrisoare de test.'; | |
$headers = 'From: [email protected]' . "\r\n" . | |
'Reply-To: [email protected]' . "\r\n" . | |
'X-Mailer: PHP/' . phpversion(); | |
if (mail($to, $subject, $message, $headers)) { | |
echo "Email trimis cu succes!"; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Coffee Shop Cart</title> | |
<style> | |
body { | |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
line-height: 1.6; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body {font-family: Arial, Helvetica, sans-serif;} | |
.img-thumbnail { | |
border-radius: 5px; | |
cursor: pointer; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Contact Us</title> | |
<style> | |
* { | |
margin: 0; | |
padding: 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
+-------------------------------+ | |
| Start | | |
+-------------------------------+ | |
| | |
v | |
+-------------------------------+ | |
| For each transaction in | | |
| TRANSACTIONS | | |
+-------------------------------+ | |
| |
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
# PROBLEMA 1: Analiza stocurilor din magazine | |
# Calculează valoarea totală a stocului pentru fiecare produs din inventar (inclusiv produsele fără stoc), | |
# sortează descrescător și creează grafic barplot. | |
library(dplyr) | |
library(ggplot2) | |
# Unele produse din inventar nu au stoc înregistrat | |
stock_records <- data.frame( | |
product_id = c(101, 103, 105, 107, 101, 103), |
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
# ============================================================================= | |
# PART 2: RENEWABLE ENERGY TRANSITION (25 points) | |
# ============================================================================= | |
# Load required libraries | |
library(readxl) | |
library(dplyr) | |
library(ggplot2) | |
library(gridExtra) |
NewerOlder