Skip to content

WEST MIDLANDS | JAN_2025 | IFEANYI MADUBUGWU | MODULE STRUCTUING AND STORING DATA | SPRINT 1 #262

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Elchacode
Copy link

Learners, PR Template

Self checklist

  • [x ] I have committed my files one by one, on purpose, and for a reason
  • [ x] I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • [x ] I have tested my changes
  • [ x] My changes follow the style guide
  • [ x] My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@Elchacode Elchacode changed the title WEST MIDLANDS | IFEANYI MADUBUGWU | MODULE STRUCTUING AND STORING DATA | SPRINT 1 WEST MIDLANDS| JAN_2025 | IFEANYI MADUBUGWU | MODULE STRUCTUING AND STORING DATA | SPRINT 1 Feb 7, 2025
@Elchacode Elchacode changed the title WEST MIDLANDS| JAN_2025 | IFEANYI MADUBUGWU | MODULE STRUCTUING AND STORING DATA | SPRINT 1 WEST MIDLANDS | JAN_2025 | IFEANYI MADUBUGWU | MODULE STRUCTUING AND STORING DATA | SPRINT 1 Feb 7, 2025
@HatefEidi HatefEidi added Needs Review Participant to add when requesting review 📅 Sprint 1 Assigned during Sprint 1 of this module labels Feb 7, 2025
@Elchacode Elchacode requested review from shieldo and CE-0 February 16, 2025 11:35
@cjyuan cjyuan added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Feb 23, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You seem to know the code well.

Some explanations are not clear enough, so I left you some comments and suggestions.

@@ -4,3 +4,6 @@ count = count + 1;

// Line 1 is a variable declaration, creating the count variable with an initial value of 0
// Describe what line 3 is doing, in particular focus on what = is doing

//Answer:
// Line 3 is an expression which calculate the current value of count and also add to 1.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"... and also add to 1" does not quite make sense. Can you rephrase the statement?

There is a term commonly used in programming to describe operation like count = count + 1. May I suggest feeding the code to ChatGPT to see how else the code can be described? You may be able to learn some programming terms in the process.

@@ -7,3 +7,6 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
// Try breaking down the expression and using documentation to explain what it means
// It will help to think about the order in which expressions are evaluated
// Try logging the value of num and running the program several times to build an idea of what the program is doing

// Answer:
// The variable num represents a randomly generated whole number between 1 and 100 (inclusive).Since minimum is 1 and maximum is 100, we generate a random number within this range using Math.random(). This function produces a decimal between 0 and 1, which we scale to the desired range.Math.floor() rounds the result down to the nearest whole number, ensuring we get an integer.Each time the code runs, num will hold a different random integer between 1 and 100.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function produces a decimal between 0 and 1

The phrase "between 0 and 1" alone is not precise enough in program specification because
it does not state clearly whether 0 and 1 are included in the range.

One concise way to specify a range of values is to use the interval notation.
You can ask ChatGPT "how to specify a range of numbers using interval notation" to learn more about such notation.

Would you try describing the return value of Math.random() and the value of num using this notation?


// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
// Answer: we need to remove comma from this expression Number(carPrice.replaceAll(",","")) to allow us convert number to string using .string() method. this allows mathematical expression to work correctly in java.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Which part of the expression converts number to string using .string() method?

  2. Typo?

... in java


// e) What do you think the variable result represents? Can you think of a better name for this variable?
//Answer: this represent a format time string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed the second part of the question.

Can you think of a better name for this variable?


// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
// Answer: totalMinutes we remove movieLength and remainingSeconds and then divide by 60.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rephrase this sentence to make it grammatically correct?

.substring(paddedPenceNumberString.length - 2)
.padEnd(2, "0");
const penceNumber = parseInt(paddedPenceNumberString, 10);
// Converts the string to a number to avoid issues.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What issues are you referring to?

What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
// console is an objective, while .log is a method(function) inside the objective console.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"objective" is not the same as "object"

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Feb 23, 2025
@Elchacode Elchacode added the Complete Volunteer to add when work is complete and review comments have been addressed label Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed Reviewed Volunteer to add when completing a review 📅 Sprint 1 Assigned during Sprint 1 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants