Skip to content

Commit

Permalink
Fix visibily, add scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tungstengmd committed Nov 19, 2023
1 parent d0366ca commit 296e0a9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset="UTF-8" />
<title>benyamin's cluttered workspace</title>
<body style="background-color:#24273a;"></body>
<script src="test.js"></script>
</head>
<body>
Expand Down
15 changes: 14 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var startScript
// the following line asks which program to start or smth idek :3
startScript = window.prompt("Which script should be started? The calculator, the one that states your favourite colour, the name swapper, the little test I made or the weekly pay calculator? Answer with 1, 2, 3, 4 and 5 respectively.")
startScript = window.prompt("Which script should be started? The calculator, the one that states your favourite colour, the name swapper, the little test I made, the weekly pay calculator, the address formatter or the times table program? Answer with 1, 2, 3, 4 and 5 respectively.")
if (startScript == 1) {
var number1
number1 = window.prompt("What number do you wish to multiply?")
Expand Down Expand Up @@ -33,5 +33,18 @@ if (startScript == 1) {
var hoursWorked
hoursWorked = window.prompt("Input how long you work.")
alert("Your weekly pay is " + "£" + hourlyRate * hoursWorked + " per week. Have a nice day!")
} else if (startScript == 6) {
var housenumber = window.prompt("Enter your house number.")
var street = window.prompt("Enter your street.")
var town = window.prompt("Enter your town.")
town = town.charAt(0).toUpperCase + town.slice(1)
var house = housenumber + ", " + street + ", " + town
alert("You live at " + house + ".")
} else if (startScript == 7) {
table = window.prompt("Which times table?")
for (let index = 0; index <= 12; index++) {
let answer = index * table
document.write(parseInt(index) + "x" + parseInt(table) + "=" + answer + "<br>")
}
}
// jamie for the love of god learn js
7 changes: 0 additions & 7 deletions test.js

This file was deleted.

0 comments on commit 296e0a9

Please sign in to comment.