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

London 9 - Tony Arora - JavaScript-Core-1-Coursework-Week1 - #439

Open
Tony-devops wants to merge 14 commits into
CodeYourFuture:masterfrom
Tony-devops:master
Open

London 9 - Tony Arora - JavaScript-Core-1-Coursework-Week1#439
Tony-devops wants to merge 14 commits into
CodeYourFuture:masterfrom
Tony-devops:master

Conversation

@Tony-devops

Copy link
Copy Markdown

Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in HOW_TO_MARK.md in the root of this repository

Your Details

  • Your Name: Tony Arora
  • Your City: London
  • Your Slack Name: Tony

Homework Details

  • Module: JS 1
  • Week: 1

Notes

  • What did you find easy? exercises and mandatory

  • What did you find hard? 8 ball

  • What do you still not understand? whether the 8 ball needed just whether the answer was between positive tonegative or all one random answer from the style of answer

  • Any other notes?

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

let greeting="Hello World"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @Tony-devops ,
Generally, when you're writing a variable declaration like this, you need to add a ; at the end. ; is used to indicate the end of a statement in JS. Sometimes a ; can be omitted but it's generally good practice to put a ; at the end of statements.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

got it and same with sapcing. I need to shed the bad habits quickly. thanks

Comment thread exercises/D-strings/exercise.js Outdated
Comment thread exercises/D-strings/exercise.js Outdated
@@ -1,3 +1,5 @@
// Start by creating a variable `message`

let first="My name is"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'll let you update the formatting here yourself 😃


let first="My name is"
let second=" King Tony"
let message=first + second

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't forget your semi-colons on the end of these statements, too.

@@ -1,3 +1,4 @@
// Start by creating a variable `message`

var name = "tony";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

At the moment, you're using var to declare a varibable. We probably need to update our exercises: however, whenever you're declaring a variable be sure to use the let or const keyword. You'll learn more about why this is the case later on in the course.

@@ -1 +1,5 @@
// Start by creating a variables `numberOfStudents` and `numberOfMentors`
let numOfStudents=15;
let numOfMentors=8;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same issue again with spaces. Make sure you come back and tweak these lines 😃

Suggested change
let numOfMentors=8;
let numOfMentors = 8;

// Start by creating a variables `numberOfStudents` and `numberOfMentors`
let numOfStudents=15;
let numOfMentors=8;
let abs=numOfMentors+numOfStudents;

@Dedekind561 Dedekind561 Nov 30, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How can you improve the readability of your code here ?
You've created a variable called abs but it's not immediately apparent to me what this means. Remember your code is not only read by a computer, but also by other people too! So remember to think carefully about your choice of variable names.

@@ -1,5 +1,6 @@
function halve(number) {
// complete the function here
return number/2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same issue with spacing applies here too - you can leave a space between number, the / and the 2.

@@ -1,5 +1,6 @@
function triple(number) {
// complete function here
return number*number*number

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Spacing here 👓

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And semi-colon 😄

@@ -1,6 +1,7 @@
// Complete the function so that it takes input parameters
function multiply() {
function multiply(a,b) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As with the other statements, in a function declaration here it is also convention to place spaces between parameters:

Suggested change
function multiply(a,b) {
function multiply(a, b) {

// Write your function here

function createGreeting(name){
return ("Nice to meet you " + name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here you've wrapped the return value in parentheses.
Do you need these parentheses in order for this function to work?

function summed(a,b){
return a+b
};
let sum =summed(13,24)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

summed is a cool variable name 😎. Can you explain why it is a good variable name in this context though?


function convertToBRL() {}
function convertToBRL(brazil) {
let ninetyNine=(brazil*99)/100;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's think about how we can make this code even clearer.
You've created a variable to save the value after you've taken away 1%. But what about the expression - ninetyNine * 5.7 - what does this represent ? Could you store this expression in a variable and give it a name so it's clearer what exactly you're calculating.

Comment thread extra/3-magic-8-ball.js
This function should expect to be called with any value which was returned by the shakeBall function.
*/
function checkAnswer(answer) {
function checkAnswer(string) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why did you change the name of this parameter from answer to string?

Comment thread extra/3-magic-8-ball.js
//Write your code in here
for (let i=0; i<4;i++){
let list=listsOfAnswers[i];
for (let j = 0; j < 5; j++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good attempt at variable naming here! A little wordy perhaps, but easier for me to work out what's going on in your code very quickly.

Comment thread mandatory/4-tax.js

function addTaxAndFormatCurrency() {}
function addTaxAndFormatCurrency(currency) {
let first=calculateSalesTax(currency);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Think about your indenting here - how can you update these variable declarations to make your code more readable. Also think about the naming of your variables here again. For example, what does the variable first mean ?

@Dedekind561 Dedekind561 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @Tony-devops,
I've just finished your review - sorry I didn't manage to finish it yesterday!
Well done on your first piece of JS Coursework!
I'm already seeing lots of good work here - good variable names and sound solutions to the exercises, including the extra exercises.
I think the main thing to focus on at the moment is your code formatting. If you fix this early on in the course it's going to make your life way easier :)
Well done!

@Tony-devops

Tony-devops commented Dec 1, 2022 via email

Copy link
Copy Markdown
Author

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants