-
-
Notifications
You must be signed in to change notification settings - Fork 235
Glasgow | 25-ITP-SEP | Fares Bakhet | Sprint 1 | coursework/sprint-1 #724
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
base: main
Are you sure you want to change the base?
Glasgow | 25-ITP-SEP | Fares Bakhet | Sprint 1 | coursework/sprint-1 #724
Conversation
…e line to print the result
declaring a new variable priceAfterOneYear: | ||
let priceAfterOneYear = "8,543"; | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
priceDifference and percentageChange are also variables. Although their values are fixed after assignment due to the use of the const keyword, they are still considered variables in JavaScript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenzyns, I missed these two🤔😥 I will add them now.
Thanks a lot.
// d) Interpret line 4, what does the expression assigned to totalMinutes mean? | ||
|
||
/* | ||
The expression gives the completed total minutes of the movie, by subtract the movie length in sec from the remaining seconds and divide the result by 60 to convert it to minutes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct. Just to slightly rearrange the wording, you could say 'subtract the remainingSeconds from the movieLength...'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenzyns ,
Okay, I'll fix it right now 👍👍
/* | ||
The variable result shows(display) the total length of the movie in three sections (Hours:Minutes:seconds) in string format. | ||
I can think of "MovieDuration" as a better name because it gives more description to the output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a convention to start a variable name with lowercase, though not a rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenzyns, I just heard this info on a video a couple of hours ago😁😁 it's like writing code.
Answer: | ||
-console is a built-in object. | ||
-log and assert are properties of that object, specifically functions (methods). | ||
-The console.assert() static method writes an error message to the console if the assertion is false. If the assertion is true, nothing happens. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for console.assert(condition, message); you provide a boolean expression as the 1st argument and message string if false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenzyns ,
Do I need to rephrase my expression, for example, [if the condition is false, it prints an error message in the console. If the condition is true, it doesn’t output anything. Should I avoid using Boolean words (true, false)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fares-Bakhet, Apologies, didn't get notified of this. No you don't need to rephrase. Just to be aware of the what arguments it accepts.
Learners, PR Template
Self checklist
Changelist
I have made all the changes required and run the tests needed.
Questions
No questions.