Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions HomeWork/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HomeWork4</title>
<title>Button Functions</title>
</head>
<body>
<script src="./js/script.js" ></script>
<button onclick="showDefinition('html')">HTML</button>
<button onclick="showDefinition('css')">CSS</button>

<script>
function showDefinition(technology) {
if (technology === 'html') {
alert('HTML stands for HyperText Markup Language. It is the standard markup language for creating web pages.');
} else if (technology === 'css') {
alert('CSS stands for Cascading Style Sheets. It is a style sheet language used for describing the look and formatting of a document written in HTML.');
}
}
</script>
<script src="./js/script.js"></script>
</body>
</html>
</html>
53 changes: 53 additions & 0 deletions HomeWork/js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict';

// First task

// написати об*єкт студента який буде виводити ім*я, спеціальнісь, середній
// бал і кількість пропущених занять

// Student Object
function Student(name, specialization, averageGrade, missedClasses) {
this.name = name;
this.specialization = specialization;
this.averageGrade = averageGrade;
this.missedClasses = missedClasses;
}

// Method to display student information
Student.prototype.displayInfo = function () {
console.log(`Name: ${this.name}, Specialization: ${this.specialization}, Average Grade: ${this.averageGrade}, Missed Classes: ${this.missedClasses}`);
};

// Three instances of students
const student1 = new Student("John Doe", "Computer Science", 85, 2);
const student2 = new Student("Jane Smith", "Mathematics", 92, 1);
const student3 = new Student("Bob Johnson", "Physics", 78, 3);

// Displaying information using the method
student1.displayInfo();
student2.displayInfo();
student3.displayInfo();



// Second task

// Написати функцію магазин, яка отримує назву товару, ціну за кг і кількість товару
// функція має повертати назву товару і вартість
// перевірити на варіантах:
// 1) banana 30, 4,5
// 2) cherry 58, 1,3
// 3) jrange 89. 3,4

// Shop function
function shop(product, pricePerKg, quantity) {
const totalCost = pricePerKg * quantity;
return `Product: ${product}, Total Cost: ${totalCost}`;
}

// Testing with different products
console.log(shop("banana", 30, 4.5));
console.log(shop("cherry", 58, 1.3));
console.log(shop("jrange", 89, 3.4));


14 changes: 7 additions & 7 deletions Lesson/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<title>Lesson 5</title>
</head>
<body>
<div>
<p>Ann</p>
</div>
<div>
<div>
<p>Ann</p>
</div>
<div>
<p>Olga</p>
</div>
<div>
</div>
<div>
<p>Ivan</p>
</div>
</div>

<div>
<button id="wom">Жіночий одяг</button>
Expand Down
19 changes: 10 additions & 9 deletions Lesson/js/script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//замикання
замикання

// function createUrl(domain) {
// return function (url) {
Expand All @@ -17,7 +17,8 @@

//_________________________//
//_________________________//
//this

this

// function hello() {
// console.log("hello", this);
Expand Down Expand Up @@ -47,7 +48,7 @@
// this.style.background = "green";
// }

// // document.querySelector("div").onclick = changeColor;
// document.querySelector("div").onclick = changeColor;

// let user = document.querySelectorAll("div");

Expand All @@ -70,7 +71,7 @@

// list.showList();

//========= bind
========= bind

// function hello() {
// console.log(this);
Expand Down Expand Up @@ -103,7 +104,7 @@
// const nataInfo = user.info.bind(Nata, "Odesa");
// nataInfo();

//========= call
========= call

// const userInfo = {
// name: "name",
Expand All @@ -124,7 +125,7 @@

// userInfo.logInfo.call(Vano, "developer");

//apply
apply

// const showUserInfo = {
// name: name,
Expand All @@ -139,12 +140,12 @@
// },
// };

// const Vano = {
// const Vano1 = {
// name: "Ivan",
// age: 45,
// };

// showUserInfo.logInfo.apply(Vano, ["developer", "Lviv"]);
// showUserInfo.logInfo.apply(Vano1, ["developer", "Lviv"]);

///////////////////////////////////
///////////////////////////////////
Expand Down Expand Up @@ -180,7 +181,7 @@
// const man = {
// items: ["Костюм, рубашка"],
// };

// const child = {
// items: ["майка, шорти"],
// };
Expand Down