Skip to content

Commit a7ce6b5

Browse files
committed
i made the edits requested
1 parent fbdf964 commit a7ce6b5

4 files changed

Lines changed: 44 additions & 11 deletions

File tree

Sprint-1/1-key-exercises/3-paths.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const base = filePath.slice(lastSlashIndex + 1);
1717
// Create a variable to store the ext part of the variable
1818

1919
const firstSlashIndex = filePath.indexOf("/");
20-
const dir = filePath.slice(firstSlashIndex + 1, lastSlashIndex - 1);
20+
const dir = filePath.slice(firstSlashIndex + 1, lastSlashIndex);
2121

2222
const lastdotindex = filePath.lastIndexOf(".");
2323
const ext = filePath.slice(lastdotindex);

Sprint-1/2-mandatory-errors/4.js

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,40 @@
55

66
// the times are in the wrong places ie:-20:53 is not a twelve hour time and as they are const they cant be directly changed
77

8-
let twelveHourClockTime = "20:53";
9-
let twelthHour = twelveHourClockTime.substring(0, twelveHourClockTime.length -3);
10-
if (twelthHour >12) {twelthHour = twelthHour - 12};
11-
let twelthMinutes = twelveHourClockTime.substring(2, twelveHourClockTime.length)
8+
let twelveHourClockTime = "15.00";
9+
let twelthHour = twelveHourClockTime.substring(
10+
0,
11+
twelveHourClockTime.length - 3
1212

13-
let twentyFourHourClockTime = "08:53";
13+
);
1414

15+
let sufix =".AM"
16+
17+
if (twelthHour === "00") {
18+
twelthHour = "12";
19+
}
20+
if (twelthHour > 12) {
21+
twelthHour = twelthHour - 12;
22+
sufix =".PM"
1523

16-
console.log(`${twelthHour}${twelthMinutes}`);
17-
console.log(twentyFourHourClockTime);
24+
}
25+
let twelthMinutes = twelveHourClockTime.substring(
26+
2,
27+
twelveHourClockTime.length
28+
);
29+
30+
31+
let twentyFourHourClockTime = "08:53.pm";
32+
let twentyFour = twentyFourHourClockTime.substring(0,
33+
twentyFourHourClockTime.length -6)
34+
twentyFour = parseInt(twentyFour);
35+
36+
37+
if (twentyFourHourClockTime.match (/(pm|PM)/g)){
38+
twentyFour = twentyFour + 12;
39+
}
40+
let twentyFourMinuies = twentyFourHourClockTime.substring(2, twentyFourHourClockTime.length -3);
41+
42+
43+
console.log(`${twelthHour}${twelthMinutes}${sufix}`);
44+
console.log(`${twentyFour}${twentyFourMinuies}`);

Sprint-1/3-mandatory-interpret/2-time-format.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const movieLength = 4; // length of movie in seconds
1+
const movieLength = 8784; // length of movie in seconds
22

33
const remainingSeconds = movieLength % 60;
44
const totalMinutes = (movieLength - remainingSeconds) / 60;
@@ -13,6 +13,12 @@ console.log(result);
1313

1414
// a) How many variable declarations are there in this program?
1515
// there are 6 declarations
16+
// const movieLength
17+
// const remainingSeconds
18+
// const totalMinutes
19+
// const remainingMinutes
20+
// const totalHours
21+
// const result
1622

1723
// b) How many function calls are there?
1824
// 0

Sprint-1/4-stretch-explore/chrome.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ a pop up appered saying hello world
1616
Now try invoking the function `prompt` with a string input of `"What is your name?"` - store the return value of your call to `prompt` in an variable called `myName`.
1717

1818
What effect does calling the `prompt` function have?
19-
it give a pop up eith a text input
19+
it give a pop up with a text input
2020
What is the return value of `prompt`?
21-
the return is what is entred into the text input
21+
the return is what is entered into the text input if it is blank you will get ''

0 commit comments

Comments
 (0)