Skip to content

Conversation

@vrwatson
Copy link

@vrwatson vrwatson commented Dec 9, 2020

No description provided.

let radius = 8

// * Calculate the circumference based on the radius, and log "The circumference is `circumferenceResult`".
let pI = Math.PI

Choose a reason for hiding this comment

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

Love that you stored this in a variable!

console.log(sentenceCircumference)

// * Calculate the area based on the radius, and log "The area is `areaOfCircle`".
let areaOfCircle = pI * (radius * radius)

Choose a reason for hiding this comment

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

radius * radius is correct but look up Math.pow or other alternate ways to square numbers in Javascript

Copy link
Author

Choose a reason for hiding this comment

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

Yes. LOL

I tried ^ b/c in my mind that's how you do exponential in calculations but of course, that didn't work. So I wrote it out. And after I had moved on I went back and saw that ** does exponents. So it would be (radius ** 2). Thanks for the feedback.

// * 3
let a = 2603

let finalDigit = a % 2600

Choose a reason for hiding this comment

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

This is correct, but only for your one input case. Think about an answer that could be correct universally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants