-
-
Notifications
You must be signed in to change notification settings - Fork 218
London | 25-ITP-Sep | Adnaan Abo | Sprint 1 | Coursework/sprint 1 #711
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?
Conversation
Answered question about the assignment and also tested the code by logging the count variable to console
modified: Sprint-1/1-key-exercises/3-paths.js modified: Sprint-1/1-key-exercises/4-random.js
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes) |
1 similar comment
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes) |
Your PR couldn't be matched to an assignment in this module. Please check its title is in the correct format, and that you only have one PR per assignment. If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). |
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes) |
1 similar comment
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes) |
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes) |
1 similar comment
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring-and-Testing-Data Sprint 1) doesn't match expected format (example: 'Sprint 2', without quotes) |
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.
Good start on this sprint's tasks, I have spotted a few areas where you could improve code further
// Read the code and then answer the questions below | ||
|
||
// a) How many function calls are there in this file? Write down all the lines where a function call is made | ||
// there are 5 function calls in this file, they are on lines 1, 2, 5, 6 and 9 |
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.
Are you sure these numbers are correct? How are you identifying function calls?
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.
Hello,
Thank you for the feedback.
there are 5 function calls and, they are on lines 4, 5, and 10
function calls: replaceAll(), replaceAll(), Number(), Number(), console.log()
// the variable reassignment statements are on lines 5 and 6 | ||
|
||
// d) Identify all the lines that are variable declarations | ||
// the variable declaration statements are on lines 1, 2, 4, 7 and 8 |
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.
What is the variable declaration on line 4?
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.
There is no variable declaration on line 4. there are only 4 variable declarations
the variable declaration statements are on lines 1, 2, 7 and 8
The variable declarations are: let carPrice, let priceAfterOneYear, const priceDifference, const percentageChange
// the error was coming from line 5 there was a comma missing between the 2 quotations ("," "") by adding the comma the code was fixed and it worked as it should. | ||
|
||
// c) Identify all the lines that are variable reassignment statements | ||
// the variable reassignment statements are on lines 5 and 6 |
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.
Are you sure these are the correct lines? How are you counting the lines?
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.
The variable reassignments are on lines 4 and 5
The variable reassignments are: carPrice = Number(carPrice.replaceAll(",", "")), priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", "")).
// there are 6 variable declarations in this program. They are on lines 1, 3, 4, 6, 7 and 9 | ||
|
||
// b) How many function calls are there? | ||
// there are 2 function calls in this program. They are on lines 9 and 10 |
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.
Which functions are called on lines 9 and 10?
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.
Hello,
Thank you for the feedback there is only one function call in the script in question and the function call is in line 10 and the function call is console.log(result);
seconds and then dividing that result by 60.*/ | ||
|
||
// e) What do you think the variable result represents? Can you think of a better name for this variable? | ||
/* the variable result represents the total length of the movie in hours, minutes and seconds. A better name for this variable could |
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.
Is it clear what the difference is between movieDuration and movieLength? Could I understand the difference by quickly reading these two variable names?
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.
Not really — they could easily be confused, especially in a larger codebase where someone is scanning quickly.
we can change movieDuration to something like formattedmovieDuration
be movieDuration.*/ | ||
|
||
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer | ||
// yes this code will work for all values of movieLength as long as the value is a non-negative integer representing the length of a movie in seconds. |
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.
Are you sure there are no values that might give unexpected or oddly formatted 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.
The code will work correctly, but it can produce unexpected or oddly formatted output in terms of readability, especially for values less than 10.
Expected value: 02:09:44
current code value: 2:9:44
Thanks for making those clarifications, this task is now complete |
Self checklist
Completed Coursework/sprint 1 by fixing code, testing code and making sure the code is functional, and answering questions regarding functionality of code.