| Periksa | Kunci | |||
|---|---|---|---|---|
| Kecepatan Akhir : | m/s | |||
| Jarak : | m |
| Periksa | Kunci | |||
|---|---|---|---|---|
| Seri Rs : | ohm | |||
| Paralel Rp : | ohm |
<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Program Soal Fisika - Blog</title>
<style>
.container-fisika {
font-family: Arial, sans-serif;
width: 100%;
max-width: 750px;
background-color: #e6e699;
border: 3px solid #0055ff;
border-radius: 8px;
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
margin: 0 auto 30px auto;
overflow: hidden;
box-sizing: border-box;
}
.container-fisika * { box-sizing: border-box; }
.app-header {
background: linear-gradient(to bottom, #0055ff, #0022aa);
color: white;
padding: 8px 15px;
font-weight: bold;
font-size: 14px;
display: flex;
justify-content: space-between;
}
.app-body { padding: 20px; }
.program-title {
text-align: center;
color: #8b0000;
font-size: 18px;
font-weight: bold;
background-color: #f0f0d0;
padding: 10px;
border: 1px solid #999;
margin-bottom: 20px;
border-radius: 4px;
}
.main-layout {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}
@media (max-width: 600px) {
.main-layout { grid-template-columns: 1fr; }
}
.soal-box {
background-color: white;
border: 1px solid #555;
padding: 15px;
color: #000080;
font-size: 14px;
line-height: 1.5;
min-height: 150px;
}
.soal-title {
font-weight: bold;
color: #0000ff;
margin-bottom: 5px;
}
.input-box {
display: flex;
flex-direction: column;
gap: 12px;
justify-content: center;
}
.input-group {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 10px;
}
.input-group label {
font-weight: bold;
color: #0000ff;
font-size: 14px;
flex: 1;
text-align: right;
}
.input-group input {
width: 80px;
padding: 4px;
font-size: 14px;
text-align: center;
border: 1px solid #777;
}
.input-group .unit {
width: 45px;
font-size: 13px;
color: #333;
}
.checking-zone {
background-color: #40e0d0;
border: 2px solid #00aaaa;
margin-top: 20px;
padding: 15px;
border-radius: 4px;
overflow-x: auto;
}
.zone-title {
color: #ff0000;
font-weight: bold;
font-size: 14px;
margin-bottom: 10px;
}
.table-check {
width: 100%;
border-collapse: collapse;
}
.table-check th {
background-color: #000;
color: #40e0d0;
font-size: 12px;
padding: 4px;
text-align: center;
}
.table-check th.kunci-header {
background-color: #e6a8d7;
color: #000;
}
.table-check td {
padding: 6px 4px;
font-size: 14px;
}
.table-check input {
width: 70px;
padding: 2px;
text-align: center;
}
.status-cell {
background-color: white;
text-align: center;
font-weight: bold;
border: 1px solid #999;
width: 80px;
}
.kunci-cell {
background-color: white;
text-align: center;
font-weight: bold;
color: #000080;
border: 1px solid #999;
width: 80px;
}
.btn-action {
background-color: #ffff00;
color: black;
border: 2px solid #555;
padding: 8px 15px;
font-weight: bold;
cursor: pointer;
border-radius: 4px;
display: block;
margin: 15px auto 0 auto;
}
.btn-action:hover { background-color: #eeee00; }
.footer-tag {
font-size: 20px;
font-weight: bold;
margin-top: 15px;
}
.status-benar { color: green; }
.status-salah { color: red; }
</style>
</head>
<body>
<div class="container-fisika">
<div class="app-header">
<span>Soal Fisika - Kelas A</span>
<span>✕</span>
</div>
<div class="app-body">
<div class="program-title">Program Menghitung Kecepatan dan Jarak</div>
<div class="main-layout">
<div>
<div class="soal-title">SOAL :</div>
<div class="soal-box">
Sebuah benda bergerak dengan kecepatan awal 50 m/s. Jika benda tersebut bergerak dengan percepatan tetap sebesar 10 m/s². Berapakah kecepatan benda tersebut setelah bergerak selama 20 sekon ? Berapakah Jarak yang ditempuhnya ?
</div>
</div>
<div class="input-box">
<div class="input-group">
<label>Kecepatan Awal :</label>
<input type="number" id="a_v0" value="50">
<span class="unit">m/s</span>
</div>
<div class="input-group">
<label>Percepatan :</label>
<input type="number" id="a_a" value="10">
<span class="unit">m/s²</span>
</div>
<div class="input-group">
<label>Waktu :</label>
<input type="number" id="a_t" value="20">
<span class="unit">s</span>
</div>
</div>
</div>
<div class="checking-zone">
<div class="zone-title">JAWABAN ANDA :</div>
<table class="table-check">
<thead>
<tr>
<th style="background: transparent; border: none; width: 30%;"></th>
<th style="background: transparent; border: none; width: 20%;"></th>
<th>Periksa</th>
<th class="kunci-header">Kunci</th>
<th style="background: transparent; border: none; width: 10%;"></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: right; font-weight: bold; color: blue;">Kecepatan Akhir :</td>
<td><input type="number" id="user_vt"></td>
<td id="status_vt" class="status-cell"></td>
<td id="kunci_vt" class="kunci-cell"></td>
<td style="padding-left: 5px; font-weight: bold;">m/s</td>
</tr>
<tr>
<td style="text-align: right; font-weight: bold; color: blue;">Jarak :</td>
<td><input type="number" id="user_s"></td>
<td id="status_s" class="status-cell"></td>
<td id="kunci_s" class="kunci-cell"></td>
<td style="padding-left: 5px; font-weight: bold;">m</td>
</tr>
</tbody>
</table>
<button class="btn-action" onclick="periksaKelasA()">PERIKSA JAWABAN</button>
</div>
<div class="footer-tag" style="color: #ff0000;">KHUSUS Kelas A</div>
</div>
</div>
<div class="container-fisika">
<div class="app-header">
<span>Soal Fisika - Kelas C</span>
<span>✕</span>
</div>
<div class="app-body">
<div class="program-title">Program Menghitung Hambatan Pengganti pada Rangkaian Seri dan Paralel</div>
<div class="main-layout">
<div>
<div class="soal-title">SOAL :</div>
<div class="soal-box">
Sebuah rangkaian listrik terdiri dari 3 buah resistor, masing-masing R1 = 20 ohm, R2 = 30 ohm dan R3 = 60 ohm. Jika ketiga resistor tersebut dirangkai seri, berapakah hambatan penggantinya ? Berapa hambatan penggantinya jika ketiganya dirangkai paralel ?
</div>
</div>
<div class="input-box">
<div class="input-group">
<label>R1 :</label>
<input type="number" id="c_r1" value="20">
<span class="unit">ohm</span>
</div>
<div class="input-group">
<label>R2 :</label>
<input type="number" id="c_r2" value="30">
<span class="unit">ohm</span>
</div>
<div class="input-group">
<label>R3 :</label>
<input type="number" id="c_r3" value="60">
<span class="unit">ohm</span>
</div>
</div>
</div>
<div class="checking-zone">
<div class="zone-title">JAWABAN ANDA :</div>
<table class="table-check">
<thead>
<tr>
<th style="background: transparent; border: none; width: 30%;"></th>
<th style="background: transparent; border: none; width: 20%;"></th>
<th>Periksa</th>
<th class="kunci-header">Kunci</th>
<th style="background: transparent; border: none; width: 10%;"></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: right; font-weight: bold; color: blue;">Seri Rs :</td>
<td><input type="number" id="user_rs"></td>
<td id="status_rs" class="status-cell"></td>
<td id="kunci_rs" class="kunci-cell"></td>
<td style="padding-left: 5px; font-weight: bold;">ohm</td>
</tr>
<tr>
<td style="text-align: right; font-weight: bold; color: blue;">Paralel Rp :</td>
<td><input type="number" id="user_rp"></td>
<td id="status_rp" class="status-cell"></td>
<td id="kunci_rp" class="kunci-cell"></td>
<td style="padding-left: 5px; font-weight: bold;">ohm</td>
</tr>
</tbody>
</table>
<button class="btn-action" onclick="periksaKelasC()">PERIKSA JAWABAN</button>
</div>
<div class="footer-tag" style="color: #000080;">KHUSUS KELAS C</div>
</div>
</div>
<script>
function periksaKelasA() {
const v0 = parseFloat(document.getElementById('a_v0').value) || 0;
const a = parseFloat(document.getElementById('a_a').value) || 0;
const t = parseFloat(document.getElementById('a_t').value) || 0;
const kunci_vt = v0 + (a * t);
const kunci_s = (v0 * t) + (0.5 * a * t * t);
document.getElementById('kunci_vt').innerText = kunci_vt;
document.getElementById('kunci_s').innerText = kunci_s;
const u_vt = parseFloat(document.getElementById('user_vt').value);
const u_s = parseFloat(document.getElementById('user_s').value);
const statusVtEl = document.getElementById('status_vt');
if (!isNaN(u_vt)) {
if (Math.abs(u_vt - kunci_vt) < 0.01) {
statusVtEl.innerText = "BENAR";
statusVtEl.className = "status-cell status-benar";
} else {
statusVtEl.innerText = "SALAH";
statusVtEl.className = "status-cell status-salah";
}
} else { statusVtEl.innerText = ""; }
const statusSEl = document.getElementById('status_s');
if (!isNaN(u_s)) {
if (Math.abs(u_s - kunci_s) < 0.01) {
statusSEl.innerText = "BENAR";
statusSEl.className = "status-cell status-benar";
} else {
statusSEl.innerText = "SALAH";
statusSEl.className = "status-cell status-salah";
}
} else { statusSEl.innerText = ""; }
}
function periksaKelasC() {
const r1 = parseFloat(document.getElementById('c_r1').value) || 0;
const r2 = parseFloat(document.getElementById('c_r2').value) || 0;
const r3 = parseFloat(document.getElementById('c_r3').value) || 0;
const kunci_rs = r1 + r2 + r3;
let kunci_rp = 0;
if (r1 > 0 && r2 > 0 && r3 > 0) {
kunci_rp = 1 / ((1/r1) + (1/r2) + (1/r3));
kunci_rp = Math.round(kunci_rp * 100) / 100;
}
document.getElementById('kunci_rs').innerText = kunci_rs;
document.getElementById('kunci_rp').innerText = kunci_rp;
const u_rs = parseFloat(document.getElementById('user_rs').value);
const u_rp = parseFloat(document.getElementById('user_rp').value);
const statusRsEl = document.getElementById('status_rs');
if (!isNaN(u_rs)) {
if (Math.abs(u_rs - kunci_rs) < 0.01) {
statusRsEl.innerText = "BENAR";
statusRsEl.className = "status-cell status-benar";
} else {
statusRsEl.innerText = "SALAH";
statusRsEl.className = "status-cell status-salah";
}
} else { statusRsEl.innerText = ""; }
const statusRpEl = document.getElementById('status_rp');
if (!isNaN(u_rp)) {
if (Math.abs(u_rp - kunci_rp) < 0.1) {
statusRpEl.innerText = "BENAR";
statusRpEl.className = "status-cell status-benar";
} else {
statusRpEl.innerText = "SALAH";
statusRpEl.className = "status-cell status-salah";
}
} else { statusRpEl.innerText = ""; }
}
</script>
</body>
</html>

