generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 196
LONDON | MAY_25 | EMILIANO URUENA | SPRINT2 #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Emilianouz
wants to merge
8
commits into
CodeYourFuture:main
Choose a base branch
from
Emilianouz:coursework/sprint-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
17a05f8
1. Key implemented MSTD Sprint-3
Emilianouz cedb7b2
Block errors MSTD_Sprint2 predictions and interpretations.
Emilianouz a8978ac
Mandatory debug MSTD_Sprint2 debug explained and solved.
Emilianouz b1f3dfb
Mandatory implement MSTD_Sprint2 solved.
Emilianouz aacb73d
4.Mandatory Interpret MSTD_Sprint2 answered.
Emilianouz e304626
format-time MSTD_Sprint2 function to convert 24 hour clock times to 1…
Emilianouz 0473f98
Revert "1. Key implemented MSTD Sprint-3"
Emilianouz 74449f4
Changes required, sorted.
Emilianouz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
// Predict and explain first... | ||
|
||
/* | ||
The console is returning decimalNumber, which is the original number instead of the result of the function. | ||
The variable decimalNumber was declared in the function parameters. | ||
*/ | ||
// Why will an error occur when this program runs? | ||
// =============> write your prediction here | ||
|
||
// An error of variable, because the variable decimalNumber must was declared inside of the function. | ||
// Try playing computer with the example to work out what is going on | ||
|
||
function convertToPercentage(decimalNumber) { | ||
const decimalNumber = 0.5; | ||
const percentage = `${decimalNumber * 100}%`; | ||
|
||
return percentage; | ||
} | ||
|
||
console.log(decimalNumber); | ||
|
||
// =============> write your explanation here | ||
|
||
// The variable decimalNumber was declared inside the function. Also, the console.log was trying to call the variable decimalNumber. | ||
// Finally, correct the code to fix the problem | ||
// =============> write your new code here | ||
|
||
function convertToPercentage(decimalNumber) { | ||
const percentage = `${decimalNumber * 100}%`; | ||
return percentage; | ||
} | ||
console.log(convertToPercentage(0.5)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
|
||
// Predict and explain first BEFORE you run any code... | ||
|
||
// this function should square any number but instead we're going to get an error | ||
/* | ||
The function suppose to elevate a number to the square. However, the parameter of the function, | ||
the declaration of the variable 'num' and the execution is wrong. | ||
*/ | ||
|
||
// =============> write your prediction of the error here | ||
// Parameters error line 11, 3. | ||
|
||
function square(3) { | ||
return num * num; | ||
} | ||
|
||
// =============> write the error message here | ||
|
||
/* | ||
SyntaxError: Unexpected number | ||
function square(3) | ||
^ | ||
*/ | ||
// =============> explain this error message here | ||
|
||
// The parameter of the function expects a name instead of a number. | ||
// Finally, correct the code to fix the problem | ||
|
||
// =============> write your new code here | ||
|
||
|
||
function square(num){ | ||
return num * num; | ||
} | ||
//console.log(square(3)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
// Predict and explain first... | ||
|
||
// The function suppose to multiply two numbers. The execution of the function includes a console.log call instead of a return. | ||
// =============> write your prediction here | ||
|
||
// The console is going to present two different messages. No one with the expected result. | ||
function multiply(a, b) { | ||
console.log(a * b); | ||
} | ||
|
||
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`); | ||
|
||
// =============> write your explanation here | ||
|
||
// The console shows the result of the multiplication 10 x 32 = 320, and the text message with the result Undefined. | ||
// Finally, correct the code to fix the problem | ||
// =============> write your new code here | ||
function multiply(a,b){ | ||
return a * b ; | ||
} | ||
console.log(`The result of multiplying 10 ad 32 is ${multiply(10,32)}`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.