.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Books Information</title>
|
||||
<title>Лабораторная работа No6</title>
|
||||
<style>
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
@@ -176,7 +176,7 @@
|
||||
tableBody.appendChild(row);
|
||||
});
|
||||
|
||||
const json = JSON.stringify(books);
|
||||
const json = JSON.stringify(books, null, 2);
|
||||
document.getElementById("json").value = json;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,11 @@
|
||||
<button onclick="run()">Выполнить</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3>Результат:</h3>
|
||||
<div id="result"></div>
|
||||
</div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
<script>
|
||||
function run() {
|
||||
@@ -74,15 +79,27 @@
|
||||
func = countCalls(func);
|
||||
|
||||
characteristics = [];
|
||||
if (isFindMin)
|
||||
names = []
|
||||
if (isFindMin) {
|
||||
characteristics.push(findMin);
|
||||
if (isCountPositive)
|
||||
names.push('Минимум');
|
||||
}
|
||||
if (isCountPositive) {
|
||||
characteristics.push(countPositive);
|
||||
if (isIsMonotonous)
|
||||
names.push('Кол-во положительных');
|
||||
}
|
||||
if (isIsMonotonous) {
|
||||
characteristics.push(isMonotonous);
|
||||
names.push('Монотонность');
|
||||
}
|
||||
|
||||
const chars = calculateCharacteristics(func, Number(xMin), Number(xMax), Number(h), characteristics);
|
||||
console.log(chars);
|
||||
|
||||
const result = document.getElementById('result');
|
||||
names.forEach((name, index) => {
|
||||
result.innerHTML += name + ': ' + chars[index] + '<br>';
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user