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

NW5-Ahmed_Mahmoud-JavaScript-Core-1-Coursework-Week1 - #377

Open
Danti8686 wants to merge 28 commits into
CodeYourFuture:masterfrom
Danti8686:master
Open

NW5-Ahmed_Mahmoud-JavaScript-Core-1-Coursework-Week1 #377
Danti8686 wants to merge 28 commits into
CodeYourFuture:masterfrom
Danti8686:master

Conversation

@Danti8686

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: Ahmed Mahmoud
  • Your City: Manchester
  • Your Slack Name: Danti

Homework Details

  • Module:JavaScript-Core-1
  • Week: Course-Week1

Notes

  • What did you find easy?
    How to create a new var, let and const.
  • What did you find hard?
    How to use return'
  • What do you still not understand?
    How to use more than function in one function.
  • Any other notes?
  • N/A

@@ -1,3 +1,6 @@
// Start by creating a variable `message`
var greetingStart = "Hi guys my name is ";
let fname = "Danti";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I see everything is fine, but remember to use camelCase when naming your variables.
let fname > let firstName or fName

// Start by creating a variable `message`

console.log(message);
let myname = "Danti";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

camelCase not observed!

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.

Yeah that's great idea 👍


const myName = " Daniel ";
let newName = myName.trim();
const message = "My name is" + myName + "and my name is " + newName.length + " characters long";

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 way of using newName.length without declaring any extra variable.

Comment thread exercises/I-floats/exercise.js Outdated
Comment on lines +1 to +6
// var numberOfStudents = 15;
// var numberOfMentors = 8;
var preciseAge = 30.612437;
var result = preciseAge / 10;
var resultWhole = Math.round(result);
console.log(resultWhole + "%"); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please have look again at the Readme file because the instruction expects something else.
Please let me know if you find any straggling!

Exercise

  • Using the variables provided in the exercise calculate the percentage of mentors and students in the group

Expected result

Percentage students: 65%
Percentage mentors: 35%


// Assign the result of calling the function the variable `result`
var result = multiply(3, 4);

multiply()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Calling function before console.log is useless, you can remove it and test it again and still get the results.

@@ -1,5 +1,9 @@
// Declare your function first

function divide(a , b) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Observe your spaces between parameters (a, b) in order to keep your parameters neat.

Comment on lines +7 to +16

function danti(a) {
return "HELOW";

}
console.log(danti() + " " + mentor1.toUpperCase() );
console.log(danti() + " " + mentor2.toUpperCase() );
console.log(danti() + " " + mentor3.toUpperCase() );
console.log(danti() + " " + mentor4.toUpperCase() );
console.log(danti() + " " + mentor5.toUpperCase() ); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The solution does not work, and you receive an error message!
Here are some threads to fix the error:

  1. For all of our mentors' names to be in uppercase, you need to declare that in your function, for example: return "Hello" + n.toUpperCase();
  2. You can call your function from the console.log and pass the mentors' variables as parameters.

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.

2 participants