Skip to content

Commit 150a31d

Browse files
committed
readme file added in speed distance time calculator
1 parent 43c5bc7 commit 150a31d

File tree

13 files changed

+158
-53
lines changed

13 files changed

+158
-53
lines changed

speed-distance-time-calculator/CalcDistance.html

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,38 @@
1313

1414
<div id="distanceContainer" style="text-align: center;">
1515
<div class="container">
16-
<div class="speedCalculator">
17-
<h1>Distance Calculator</h1>
18-
<p>Distance is the measurement of actual path covered byy any object.</p>
19-
<br>
20-
<p>Distance is the product of speed of an object to the time taken.
21-
</p>
22-
<h3 class="formula">Distance = Speed * Time
23-
</h3>
24-
<h4>SI unit of Distance is metre(m).</h4>
25-
<br>
26-
<h3><em>Fill in the speed(in m/s) and time(in seconds) and calculate the Distance. </em></h3>
27-
28-
<input type="number" id="speed" placeholder="Enter the Speed(in m/s)"
29-
><br><br>
30-
<input type="number" id="time" placeholder="Enter the time(in seconds)"
31-
><br><br>
32-
<input type="button" value="distance" id="speed" onclick="calcDistance()">
33-
<h3 id="calculatedDistanceDisplay"></h3>
34-
</div>
35-
36-
</div>
37-
<script>
38-
39-
function calcDistance() {
40-
let speed = document.getElementById("speed").value;
41-
let time = document.getElementById("time").value;
42-
let calculatedSpeedDisplay = document.getElementById("calculatedSpeedDisplay");
43-
let distance = speed * time;
44-
calculatedDistanceDisplay.innerText = `The calculated distance is ${distance} metres.`;
45-
}
46-
47-
48-
49-
</script>
16+
<div class="speedCalculator">
17+
<h1>Distance Calculator</h1>
18+
<p>Distance is the measurement of actual path covered byy any object.</p>
19+
<br>
20+
<p>Distance is the product of speed of an object to the time taken.
21+
</p>
22+
<h3 class="formula">Distance = Speed * Time
23+
</h3>
24+
<h4>SI unit of Distance is metre(m).</h4>
25+
<br>
26+
<h3><em>Fill in the speed(in m/s) and time(in seconds) and calculate the Distance. </em></h3>
27+
28+
<input type="number" id="speed" placeholder="Enter the Speed(in m/s)"><br><br>
29+
<input type="number" id="time" placeholder="Enter the time(in seconds)"><br><br>
30+
<input type="button" value="distance" id="speed" onclick="calcDistance()">
31+
<h3 id="calculatedDistanceDisplay"></h3>
32+
</div>
33+
<button class="backButton"><a href="index.html">Back</a></button>
34+
</div>
35+
<script>
36+
37+
function calcDistance() {
38+
let speed = document.getElementById("speed").value;
39+
let time = document.getElementById("time").value;
40+
let calculatedSpeedDisplay = document.getElementById("calculatedSpeedDisplay");
41+
let distance = speed * time;
42+
calculatedDistanceDisplay.innerText = `The calculated distance is ${distance} metres.`;
43+
}
44+
45+
46+
47+
</script>
5048
</body>
5149

5250
</html>

speed-distance-time-calculator/CalcSpeed.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ <h4>SI unit of speed is m/s.</h4>
2727
<br>
2828
<h3><em>Fill in the distance(in metres) and time(in seconds) and calculate the speed. </em></h3>
2929

30-
<input type="number" id="distance" placeholder="Enter the Distance(in metres)"
31-
><br><br>
32-
<input type="number" id="time" placeholder="Enter the time(in seconds)"
33-
><br><br>
30+
<input type="number" id="distance" placeholder="Enter the Distance(in metres)"><br><br>
31+
<input type="number" id="time" placeholder="Enter the time(in seconds)"><br><br>
3432
<input type="button" value="Speed" id="speed" onclick="calcSpeed()">
3533
<h3 id="calculatedSpeedDisplay"></h3>
3634
</div>
37-
35+
<button class="backButton"><a href="index.html">Back</a></button>
3836
</div>
3937
<script>
4038

speed-distance-time-calculator/CalcTime.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ <h3><em>Fill in the distance(in metres) and speed(in m/s) and calculate the
3333
<h3 id="calculatedTimeDisplay"></h3>
3434
</div>
3535

36+
<button class="backButton"><a href="index.html">Back</a></button>
3637
</div>
3738
<script>
3839

62.9 KB
Loading
93.4 KB
Loading
276 KB
Loading
68.9 KB
Loading
126 KB
Loading
115 KB
Loading
83.2 KB
Loading

0 commit comments

Comments
 (0)