Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

London Class 7 - Ionut Tripa - Javascript Core 1 - Week 1 - #32

Closed
iTrip23 wants to merge 4 commits into
CodeYourFuture:masterfrom
iTrip23:master
Closed

London Class 7 - Ionut Tripa - Javascript Core 1 - Week 1#32
iTrip23 wants to merge 4 commits into
CodeYourFuture:masterfrom
iTrip23:master

Conversation

@iTrip23

@iTrip23 iTrip23 commented Jan 18, 2021

Copy link
Copy Markdown

Your Details

Ionut Tripa
London
Johnny

Homework Details

Javascript Core 1
Week 1

Comment thread exercises/C-variables/exercise.js Outdated
@@ -1,3 +1,3 @@
// Start by creating a variable `greeting`

var greeting = 'Hello sunshine'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps you could add a (;) at the end of the variable

@@ -1,4 +1,5 @@
// Write your function here
const createGreeting = firstName => 'Hi ' + firstName + ', How are you?';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice use of syntax and labels for variables

@oksygenn oksygenn left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great job with the homework Johnny!
Loved the short functions :)
Only had one suggestion about hard-coded values.

Comment on lines 1 to +8
var numberOfStudents = 15;
var numberOfMentors = 8;

var percentageOfStudents = Math.round(15*100/23) + '%';
var percentageOfMentors = Math.round(8*100/23) + '%';

console.log(percentageOfStudents);
console.log(percentageOfMentors);

@oksygenn oksygenn Jan 21, 2021

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi Johnny,
I have a little suggestion :)
You could add variables numberOfStudents and numberOfMentors and save the result to a new variable like total and then use all these variables in Math.round() instead of just using numbers(15, 8, 23). Something like this: Math.round(numberOfStudents*100/total).
This will make your code more flexible, so you can change numberOfStudents or numberOfMentors to any other numbers - percentage would still be calculated correctly 😉

Also, I believe the expected result was "Percentage students: 65%
Percentage mentors: 35%".

@github-actions

Copy link
Copy Markdown

Your coursework submission has been closed because nobody has interacted with it in 30 days. You are welcome to re-open it to get more feedback.

@github-actions github-actions Bot added the Stale label May 13, 2021
@github-actions github-actions Bot closed this May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants